GigAPI MCP Server
An MCP server that provides seamless integration with Claude Desktop for querying and managing timeseries data in GigAPI Timeseries Lake.
README
<img src="https://github.com/user-attachments/assets/5b0a4a37-ecab-4ca6-b955-1a2bbccad0b4" />
GigAPI MCP Server
An MCP server for GigAPI Timeseries Lake that provides seamless integration with Claude Desktop and other MCP-compatible clients.
Features
GigAPI Tools
run_select_query- Execute SQL queries on your GigAPI cluster.
- Input:
sql(string): The SQL query to execute,database(string): The database to execute against. - All queries are executed safely through GigAPI's HTTP API with NDJSON format.
list_databases- List all databases on your GigAPI cluster.
- Input:
database(string): The database to use for the SHOW DATABASES query (defaults to "mydb").
list_tables- List all tables in a database.
- Input:
database(string): The name of the database.
get_table_schema- Get schema information for a specific table.
- Input:
database(string): The name of the database,table(string): The name of the table.
write_data- Write data using InfluxDB Line Protocol format.
- Input:
database(string): The database to write to,data(string): Data in InfluxDB Line Protocol format.
health_check- Check the health status of the GigAPI server.
ping- Ping the GigAPI server to check connectivity.
Quick Start
1. Install the MCP Server
Option A: From PyPI (Recommended)
# The package will be available on PyPI after the first release
# Users can install it directly with uv
uv run --with mcp-gigapi --python 3.11 mcp-gigapi --help
Option B: From Source
# Clone the repository
git clone https://github.com/gigapi/mcp-gigapi.git
cd mcp-gigapi
# Install dependencies
uv sync
2. Configure Claude Desktop
- Open the Claude Desktop configuration file located at:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%/Claude/claude_desktop_config.json
- On macOS:
- Add the following configuration:
For the Public Demo (Recommended for Testing)
{
"mcpServers": {
"mcp-gigapi": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-gigapi",
"--python",
"3.13",
"mcp-gigapi"
],
"env": {
"GIGAPI_HOST": "gigapi.fly.dev",
"GIGAPI_PORT": "443",
"GIGAPI_TIMEOUT": "30",
"GIGAPI_VERIFY_SSL": "true",
"GIGAPI_DEFAULT_DATABASE": "mydb"
}
}
}
}
For Local Development
{
"mcpServers": {
"mcp-gigapi": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-gigapi",
"--python",
"3.13",
"mcp-gigapi"
],
"env": {
"GIGAPI_HOST": "localhost",
"GIGAPI_PORT": "7971",
"GIGAPI_TIMEOUT": "30",
"GIGAPI_VERIFY_SSL": "false",
"GIGAPI_DEFAULT_DATABASE": "mydb"
}
}
}
}
With Authentication
{
"mcpServers": {
"mcp-gigapi": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-gigapi",
"--python",
"3.13",
"mcp-gigapi"
],
"env": {
"GIGAPI_HOST": "your-gigapi-server",
"GIGAPI_PORT": "7971",
"GIGAPI_USERNAME": "your_username",
"GIGAPI_PASSWORD": "your_password",
"GIGAPI_TIMEOUT": "30",
"GIGAPI_VERIFY_SSL": "true",
"GIGAPI_DEFAULT_DATABASE": "your_database"
}
}
}
}
- Important: Replace the
uvcommand with the absolute path to youruvexecutable:which uv # Find the path - Restart Claude Desktop to apply the changes.
API Compatibility
This MCP server is designed to work with GigAPI's HTTP API endpoints:
Query Endpoints
POST /query?db={database}&format=ndjson- Execute SQL queries with NDJSON response format- All queries return NDJSON (Newline Delimited JSON) format for efficient streaming
Write Endpoints
POST /write?db={database}- Write data using InfluxDB Line Protocol
Administrative Endpoints
GET /health- Health checkGET /ping- Simple ping
Example Usage
Writing Data
Use InfluxDB Line Protocol format:
curl -X POST "http://localhost:7971/write?db=mydb" --data-binary @/dev/stdin << EOF
weather,location=us-midwest,season=summer temperature=82
weather,location=us-east,season=summer temperature=80
weather,location=us-west,season=summer temperature=99
EOF
Reading Data
Execute SQL queries via JSON POST with NDJSON format:
curl -X POST "http://localhost:7971/query?db=mydb&format=ndjson" \
-H "Content-Type: application/json" \
-d '{"query": "SELECT time, temperature FROM weather WHERE time >= epoch_ns('\''2025-04-24T00:00:00'\''::TIMESTAMP)"}'
Show Databases/Tables
# Show databases
curl -X POST "http://localhost:7971/query?db=mydb&format=ndjson" \
-H "Content-Type: application/json" \
-d '{"query": "SHOW DATABASES"}'
# Show tables
curl -X POST "http://localhost:7971/query?db=mydb&format=ndjson" \
-H "Content-Type: application/json" \
-d '{"query": "SHOW TABLES"}'
# Count records
curl -X POST "http://localhost:7971/query?db=mydb&format=ndjson" \
-H "Content-Type: application/json" \
-d '{"query": "SELECT count(*), avg(temperature) FROM weather"}'
Environment Variables
Required Variables
GIGAPI_HOST: The hostname of your GigAPI serverGIGAPI_PORT: The port number of your GigAPI server (default: 7971)
Optional Variables
GIGAPI_USERNAMEorGIGAPI_USER: The username for authentication (if required)GIGAPI_PASSWORDorGIGAPI_PASS: The password for authentication (if required)GIGAPI_TIMEOUT: Request timeout in seconds (default: 30)GIGAPI_VERIFY_SSL: Enable/disable SSL certificate verification (default: true)GIGAPI_DEFAULT_DATABASE: Default database to use for queries (default: mydb)GIGAPI_MCP_SERVER_TRANSPORT: Sets the transport method for the MCP server (default: stdio)GIGAPI_ENABLED: Enable/disable GigAPI functionality (default: true)
Example Configurations
For Local Development
# Required variables
GIGAPI_HOST=localhost
GIGAPI_PORT=7971
# Optional: Override defaults for local development
GIGAPI_VERIFY_SSL=false
GIGAPI_TIMEOUT=60
GIGAPI_DEFAULT_DATABASE=mydb
For Production with Authentication
# Required variables
GIGAPI_HOST=your-gigapi-server
GIGAPI_PORT=7971
GIGAPI_USERNAME=your_username
GIGAPI_PASSWORD=your_password
# Optional: Production settings
GIGAPI_VERIFY_SSL=true
GIGAPI_TIMEOUT=30
GIGAPI_DEFAULT_DATABASE=your_database
For Public Demo
GIGAPI_HOST=gigapi.fly.dev
GIGAPI_PORT=443
GIGAPI_VERIFY_SSL=true
GIGAPI_DEFAULT_DATABASE=mydb
Data Format
GigAPI uses Hive partitioning with the structure:
/data
/mydb
/weather
/date=2025-04-10
/hour=14
*.parquet
metadata.json
Development
Setup Development Environment
-
Install dependencies:
uv sync --all-extras --dev source .venv/bin/activate -
Create a
.envfile in the root of the repository:GIGAPI_HOST=localhost GIGAPI_PORT=7971 GIGAPI_USERNAME=your_username GIGAPI_PASSWORD=your_password GIGAPI_TIMEOUT=30 GIGAPI_VERIFY_SSL=false GIGAPI_DEFAULT_DATABASE=mydb -
For testing with the MCP Inspector:
fastmcp dev mcp_gigapi/mcp_server.py
Running Tests
# Run all tests
uv run pytest -v
# Run only unit tests
uv run pytest -v -m "not integration"
# Run only integration tests
uv run pytest -v -m "integration"
# Run linting
uv run ruff check .
# Test with public demo
python test_demo.py
Testing with Public Demo
The repository includes a test script that validates the MCP server against the public GigAPI demo:
python test_demo.py
This will test:
- ✅ Health check and connectivity
- ✅ Database listing (SHOW DATABASES)
- ✅ Table listing (SHOW TABLES)
- ✅ Data queries (SELECT count(*) FROM table)
- ✅ Sample data retrieval
PyPI Publishing
This package is automatically published to PyPI on each GitHub release. The publishing process is handled by GitHub Actions workflows:
- CI Workflow (
.github/workflows/ci.yml): Runs tests on pull requests and pushes to main - Publish Workflow (
.github/workflows/publish.yml): Publishes to PyPI when a release is created
For Users
Once published, users can install the package directly from PyPI:
# Install and run the MCP server
uv run --with mcp-gigapi --python 3.11 mcp-gigapi
For Maintainers
To publish a new version:
- Update the version in
pyproject.toml - Create a GitHub release
- The workflow will automatically publish to PyPI
See RELEASING.md for detailed release instructions.
Troubleshooting
Common Issues
- Connection refused: Check that GigAPI is running and the host/port are correct
- Authentication failed: Verify username/password are correct
- SSL certificate errors: Set
GIGAPI_VERIFY_SSL=falsefor self-signed certificates - No databases found: Ensure you're using the correct default database (usually "mydb")
Debug Mode
Enable debug logging by setting the log level:
import logging
logging.basicConfig(level=logging.DEBUG)
License
Apache-2.0 license
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Support
- Issues: GitHub Issues
- Documentation: GigAPI Documentation
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。