quote-mcp
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"sample-quote": {
"args": [
"-m",
"src.main"
],
"command": "python",
"cwd": "/path/to/sample-mcp-server",
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}
服务介绍
Sample MCP Server
**company-info-mcp MCP **.
MCP .
- ** **: Quote API
- ** **:
- **ID **: ID
- MCP Framework: FastMCP
- HTTP Server: FastAPI
- Data Validation: Pydantic
- HTTP Client: Requests
- Caching: cachetools (TTL )
- Environment: Python-dotenv
1)
pip install -r requirements.txt
2) ()
.env :
cp env.example .env
.env :
LOG_LEVEL=INFO
PORT=8098
API API .
3)
MCP (stdio)
python -m src.main
HTTP
HTTP_MODE=1 python -m src.main
HTTP http://localhost:8098 .
MCP
Claude Desktop
claude_desktop_config.json :
** :**
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - Mac:
~/Library/Application Support/Claude/claude_desktop_config.json
** :**
{
"mcpServers": {
"sample-quote": {
"command": "python",
"args": ["-m", "src.main"],
"cwd": "/path/to/sample-mcp-server",
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}
MCP
health
get_random_quote_tool
.
search_quotes_tool
.
:
keyword():limit(): (: 10, : 50)
get_quote_by_id_tool
ID .
:
quote_id(): ID
HTTP API
HTTP :
Health Check
GET /health
POST /health
GET /tools
POST /tools/{tool_name}
Content-Type: application/json
{
"keyword": "success",
"limit": 5,
"env": {
"QUOTE_API_KEY": "your_api_key"
}
}
sample-mcp-server/
src/
__init__.py
main.py # FastMCP + FastAPI HTTP
tools.py # API
requirements.txt
pyproject.toml
env.example
README.md
MCP
src/main.pysrc/tools.pyAPIpyproject.tomlrequirements.txtenv.example
API
MCP API :
- ** 1**:
arguments.env.QUOTE_API_KEY( ) - ** 2**:
.envQUOTE_API_KEY( )
MIT License
** MCP .**