Skip to main content

asktable_mcp_server project

Project description

asktable-mcp-server

Python Version PyPI Version

asktable-mcp-server 是为 AskTable 提供的 MCP 服务,支持通过 Stdio 或 SSE 协议与 AskTable SaaS 或本地部署服务交互。

Case

快速开始

安装与配置

本地先安装uv配置工具。

# On macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

参数说明

  • api_key:AskTable API 密钥(必需,环境变量)
  • datasource_id:数据源ID(必需,环境变量)
  • base_url:本地IP服务地址(可选,填写则走本地部署,不填则走SaaS)

工具介绍

  • gen_sql , 根据用户查询生成对应的SQL语句
  • gen_conclusion , 根据用户的问题,直接返回数据结果
  • list_available_datasources , 获取当前用户apikey下的可用的所有数据库(数据源)信息

启动命令示例

在使用之前需先进行以下配置

  • Stdio 模式(本地或SaaS):

    uvx asktable-mcp-server@latest --transport stdio
    
  • SSE 模式(本地或SaaS):

    #sass版
    uvx --from asktable-mcp-server@latest python -m asktable_mcp_server.sse_server
    
    #本地版
    #开启服务后会占用本地的8095端口
    uvx --from asktable-mcp-server@latest python -m asktable_mcp_server.sse_server --base_url http://your_local_ip:port/api
    

配置示例

配置mcpServers_json

以下对应需要对 `mcpServers json”进行配置的情况,根据你不同的启动命令和平台兼容的方式来选择对应的模式。

Stdio + SaaS
{
  "mcpServers": {
    "asktable-mcp-server": {
      "command": "uvx",
      "args": ["asktable-mcp-server@latest", "--transport", "stdio"],
      "env": {
        "api_key": "your_api_key",
        "datasource_id": "your_datasource_id"
      }
    }
  }
}
Stdio + 本地部署
{
  "mcpServers": {
    "asktable-mcp-server": {
      "command": "uvx",
      "args": ["asktable-mcp-server@latest", "--transport", "stdio"],
      "env": {
        "api_key": "your_api_key",
        "datasource_id": "your_datasource_id",
        "base_url": "http://your_local_ip:port/api"
      }
    }
  }
}
SSE
{
  "mcpServers": {    
    "asktable-mcp-server": {
      "url": "http://localhost:8095/sse/?apikey=your_apikey&datasouce_id=your_datasouce_id",
      "headers": {},
      "timeout": 300,
      "sse_read_timeout": 300
    }
  }
}

配置SSE URL

http://localhost:8095/sse/?apikey=your_apikey&datasouce_id=your_datasouce_id

如需进一步帮助,请查阅官方文档或联系我们。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asktable_mcp_server-0.1.8.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asktable_mcp_server-0.1.8-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file asktable_mcp_server-0.1.8.tar.gz.

File metadata

  • Download URL: asktable_mcp_server-0.1.8.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.9

File hashes

Hashes for asktable_mcp_server-0.1.8.tar.gz
Algorithm Hash digest
SHA256 ca592cc2805074c87cafe8702ccdb70be8b79ec58a1973ac996c231f906615bb
MD5 049d80929ad19c9de0fc383f5462a6b5
BLAKE2b-256 d427f9c7f6b4c7ba61c9425dbb96408f6fb20019a58e9629738695709401a192

See more details on using hashes here.

File details

Details for the file asktable_mcp_server-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for asktable_mcp_server-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 be2b262fd570a86409221677a5197f93ede3d28d26bf518d8eace8531fa9162d
MD5 5dc7d7e47872bf2c9ef25bd220e47d01
BLAKE2b-256 5db49395d2e9b926b03ed056780bee1f19a43094b1d712bf94f8b2f7330cb254

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page