Are you the author? Sign in to claim
mcp_query_table
mcp_query_table 是一个基于 playwright 的财经网页表格查询项目,支持把网页查询能力暴露为 MCP 服务。
当前统一项目目录要求如下:
/root/project/mcp_query_table
当前版本:
0.3.13
MCP 服务,供 Cline、Cherry Studio、MCP Inspector 等客户端调用Streamlit 页面,便于把查询结果进一步交给大模型分析mcp_query_table/
├── mcp_query_table/
│ ├── __main__.py
│ ├── enums.py
│ ├── playwright_helper.py
│ ├── providers/
│ ├── server.py
│ ├── sites/
│ └── tool.py
├── docs/
│ ├── ARCHITECTURE.md
│ ├── DEVELOPMENT.md
│ ├── DEPLOYMENT.md
│ ├── API.md
│ ├── FAQ.md
│ └── OPERATIONS.md
├── examples/
├── streamlit/
├── requirements.txt
└── pyproject.toml
当前机器建议 Python 环境:
/root/.venv/bin/python
cd /root/project/mcp_query_table
python3 -m pip install -r requirements.txt
python3 -m playwright install chromium
import asyncio
from mcp_query_table import AsyncBrowser, QueryType, Site, query
async def main():
async with AsyncBrowser(
endpoint="http://127.0.0.1:9222",
executable_path="/usr/bin/google-chrome",
user_data_dir="/root/.config/google-chrome",
) as browser:
page = await browser.get_page()
df = await query(
page,
query_input="收益最好的200只ETF",
query_type=QueryType.ETF,
max_page=1,
site=Site.THS,
)
print(df.to_markdown())
await browser.release_page(page)
asyncio.run(main())
标准输入输出模式:
cd /root/project/mcp_query_table
python3 -m mcp_query_table \
--format markdown \
--endpoint http://127.0.0.1:9222 \
--executable_path /usr/bin/google-chrome \
--user_data_dir /root/.config/google-chrome
SSE 模式:
cd /root/project/mcp_query_table
python3 -m mcp_query_table \
--format markdown \
--transport sse \
--host 0.0.0.0 \
--port 8000 \
--endpoint http://127.0.0.1:9222 \
--executable_path /usr/bin/google-chrome \
--user_data_dir /root/.config/google-chrome
启动后:
http://127.0.0.1:8000/ssehttp://127.0.0.1:8000/mcpuser_data_dir 里完成登录user_data_diri问财仓库根目录下提供了 iwencai_single.py,用于在不启动 MCP 服务的情况下,直接查询新版 i问财 选股页并导出结果。
安装依赖:
pip install -r iwencai_single_requirements.txt
playwright install chromium
直接运行:
python iwencai_single.py
脚本默认会:
i问财 选股结果页100条/页行业概念_single.xlsx如需复用,可直接调用:
from iwencai_single import QueryType, query_iwencai
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots
Google's universal MCP server supporting PostgreSQL, MySQL, MongoDB, Redis, and 10+ databases
Official GitHub integration for repos, issues, PRs, and CI/CD workflows