SimpleMCP

SimpleMCP

A lightweight MCP server that auto-discovers tool kits, enabling tools like SQLite queries and web searches via Tavily API.

Category
访问服务器

README

SimpleMCP

A lightweight MCP-like alternative (Model Context Protocol) server that lets you bolt on tool "kits" without touching the core. Drop a new _kit.py file in kits/, slap a @tool decorator on your functions, and the server picks them up automatically. No manual imports, no config files, no fuss.

How it works

  • Server (server.py): Three operating modes (see below). Auto-discovers all kits at startup.
  • Kits (kits/): Each kit is a Python file with @tool-decorated functions. The kits/__init__.py auto-discovers and imports every kit at startup.
  • Registry (utils/registry.py): The @tool decorator registers functions into a global dict. extract_parameters scrapes type hints to build JSON Schema for the tool's I/O.
  • Config (config.py): MCP_MODE flag (default False). Set MCP_MODE=true via env var or edit the file directly.
  • Client (client.py): Streamlit frontend that talks to the server and routes tool calls through Groq.

Kits included

  • sqlite_kit — List tables, list columns, preview rows from a SQLite database.
  • web_kit — Web search, page extraction, crawling, and mapping via the Tavily API.

Adding a new kit

  1. Create a file in kits/, e.g. kits/my_kit.py
  2. Import the decorator: from utils import tool
  3. Write your functions with type hints and docstrings:
from utils import tool

@tool
def do_something(query: str, limit: int = 10):
    """Does something cool with a query."""
    # your logic here
    return {"result": "stuff"}
  1. That's it. Restart the server and it's live.

Setup

python -m venv .venv
source .venv/bin/activate
pip install fastapi uvicorn tavily streamlit requests groq

Set your API keys:

export TAVILY_API_KEY="your-tavily-key"
export GROQ_API_KEY="your-groq-key"

Run the server:

HTTP mode (for Streamlit client / browser debugging):

uvicorn server:app --host 0.0.0.0 --port 8000

MCP HTTP mode (standard MCP endpoints over HTTP — for any MCP-compatible HTTP client):

MCP_MODE=true uvicorn server:app --host 0.0.0.0 --port 8000

Exposes a single MCP endpoint at /mcp:

  • POST /mcp — JSON-RPC 2.0 dispatch (initialize, tools/list, tools/call); responds as SSE or JSON depending on client Accept header
  • GET /mcp — SSE stream for server-initiated messages / keepalive

MCP stdio mode (for Claude Desktop and any MCP-compatible host):

python server.py

Run the client:

streamlit run client.py

Connecting to Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "SimpleMCP": {
      "command": "/absolute/path/to/SimpleMCP/venv/python.exe",
      "args": ["/absolute/path/to/server.py"],
      "env": {"TAVILY_API_KEY": "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"}
    }
  }
}

Claude Desktop will spawn server.py as a child process and communicate over stdin/stdout using MCP JSON-RPC 2.0.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选