Skip to main content
Glama

veil-mcp v2

构建 Python MCP 服务器的最佳方式。

pip install veil-mcp

快速开始 — MCP 服务器 (Claude Desktop / Cursor)

from veil_mcp import tool, MCPServer

@tool()
def turn_off_light():
    """Turn off the room light."""
    return "Light is off."

@tool(tags=["hardware"], timeout=5.0)
def toggle_relay(relay: int, state: bool) -> str:
    """Toggle a relay on or off.

    Args:
        relay (int): Relay number 1-4.
        state (bool): True for ON, False for OFF.
    """
    return f"Relay {relay} is {'ON' if state else 'OFF'}."

MCPServer(name="my-agent").run()          # stdio — for Claude Desktop / Cursor
MCPServer(name="my-agent").run_http()     # HTTP+SSE on port 8000

快速开始 — LLM 适配器

from veil_mcp import tool, LLMAdapter

@tool()
def get_time() -> str:
    """Get the current time."""
    from datetime import datetime
    return datetime.now().strftime("%I:%M %p")

adapter  = LLMAdapter(provider="anthropic")  # or openai, groq, ollama, mock
response = adapter.run("what time is it")
print(response.final_message)

安装

pip install "veil-mcp[anthropic]"   # Claude
pip install "veil-mcp[openai]"      # GPT / Groq / Ollama
pip install "veil-mcp[all]"         # everything

CLI

veil-mcp list                        # list all tools
veil-mcp schema --fmt mcp            # dump MCP schemas
veil-mcp inspect TOOL_NAME           # inspect a tool
veil-mcp call TOOL_NAME '{"key":"v"}'# call a tool directly
veil-mcp run server.py               # run as stdio MCP server
veil-mcp serve server.py --port 8000 # run as HTTP server

连接到 Claude Desktop

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "my-agent": {
      "command": "python",
      "args": ["path/to/server.py"]
    }
  }
}

提供商

提供商

安装

密钥

Anthropic

pip install anthropic

ANTHROPIC_API_KEY

OpenAI

pip install openai

OPENAI_API_KEY

Groq

pip install openai

GROQ_API_KEY

Ollama

pip install openai

无 (本地)

Mock

无

无

由 Shivank 为 Hack Club Veil 制作 · 2026

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors