UTCP Documentation MCP Server

UTCP Documentation MCP Server

Assists AI coding agents in understanding and implementing UTCP by providing documentation search, manual validation, code generation, OpenAPI conversion, and an LLM-powered expert agent.

Category
访问服务器

README

UTCP Documentation MCP Server

A comprehensive MCP server that helps AI coding agents understand and implement the Universal Tool Calling Protocol (UTCP)

TypeScript MCP License: MIT

🚀 Features

  • 🤖 LLM-Powered Expert Agent: Ask questions in natural language to an OpenAI-powered agent with deep UTCP knowledge
  • 📚 Documentation Search: Semantic search across complete UTCP specification
  • ✅ Manual Validation: Validate UTCP manuals against v1.0.1 spec with detailed errors
  • 🎨 Code Generation: Generate UTCP manual templates for HTTP, CLI, MCP, SSE protocols
  • 🔄 OpenAPI Conversion: Convert OpenAPI 3.0 specs to UTCP manuals automatically
  • 📝 Examples Library: Ready-to-use examples for weather APIs, GitHub, databases, CLI tools
  • 💡 Best Practices: Built-in guidance for naming, authentication, and implementation

📦 Installation

NPM

npm install -g utcp-docs

From Source

git clone https://github.com/yourusername/utcp-docs-mcp-server.git
cd utcp-docs-mcp-server
npm install
npm run build
npm link

🔧 Configuration

For Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "utcp-docs": {
      "command": "utcp-docs",
      "env": {
        "DOCS_PATH": "/path/to/utcp-docs",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

For Cursor IDE

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "utcp-docs": {
      "command": "npx",
      "args": ["utcp-docs"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Environment Variables

Create a .env file or set in your MCP config:

# OpenAI API Key (required for ask_utcp_expert tool)
OPENAI_API_KEY=sk-...

# Documentation path (default: current directory)
DOCS_PATH=.

# Server configuration
SERVER_NAME=utcp-docs
SERVER_VERSION=1.0.0
LOG_LEVEL=info

🛠️ Available Tools

🆕 1. Ask UTCP Expert (LLM Agent)

NEW! Ask an OpenAI-powered agent any question about UTCP:

{
  "tool": "ask_utcp_expert",
  "arguments": {
    "question": "How do I authenticate with bearer tokens?"
  }
}

The agent:

  • Has deep knowledge of the entire UTCP specification
  • Retrieves relevant documentation automatically
  • Provides detailed explanations with code examples
  • Includes source references
  • Offers best practices and guidance

Example Questions:

  • "What is body_template and when should I use it?"
  • "Show me a complete HTTP tool example with OAuth2"
  • "How do I chain CLI commands together?"
  • "Why is my tool name failing validation?"

Requires: OpenAI API key (set OPENAI_API_KEY environment variable)


2. Search UTCP Documentation

Search the complete UTCP specification:

{
  "tool": "search_utcp_docs",
  "arguments": {
    "query": "how to implement HTTP authentication",
    "section": "protocols",  // optional: introduction, protocols, guides, api
    "limit": 5               // optional: max results
  }
}

Example Response:

# Search Results for "HTTP authentication"

## Result 1: HTTP Protocol Authentication
**Section:** protocols
**Relevance:** 45

Authentication in HTTP protocols can be configured using the auth field...

3. Validate UTCP Manual

Validate your UTCP manual against the specification:

{
  "tool": "validate_utcp_manual",
  "arguments": {
    "manual": {
      "manual_version": "1.0.0",
      "utcp_version": "1.0.1",
      "tools": [...]
    }
  }
}

Response:

✅ Valid UTCP Manual
The manual passes all validation checks and conforms to UTCP v1.0.1 specification.

Or with errors:

❌ Invalid UTCP Manual

## Errors
- /tools/0/name: Tool name "GetWeather" must use snake_case
- /tools/0/tool_call_template: HTTP template requires a URL

## Warnings
- /tools/0/description: Tool description should be at least 10 characters

4. Generate UTCP Manual

Generate a UTCP manual template:

{
  "tool": "generate_utcp_manual",
  "arguments": {
    "tool_name": "get_weather",
    "description": "Get current weather for a location",
    "protocol": "http",
    "endpoint": "https://api.openweathermap.org/data/2.5/weather",
    "method": "GET",
    "parameters": {
      "location": {
        "type": "string",
        "description": "City name",
        "required": true
      }
    },
    "include_auth": true
  }
}

Supported Protocols:

  • http - RESTful HTTP APIs
  • cli - Command-line tools
  • mcp - Model Context Protocol servers
  • sse - Server-Sent Events
  • streamable_http - Streaming HTTP responses

5. Convert OpenAPI to UTCP

Convert OpenAPI 3.0 specifications to UTCP manuals:

{
  "tool": "convert_openapi_to_utcp",
  "arguments": {
    "openapi_spec": {
      "openapi": "3.0.0",
      "info": { "title": "My API", "version": "1.0.0" },
      "paths": {
        "/users": {
          "get": {
            "operationId": "getUsers",
            "summary": "List users"
          }
        }
      }
    }
  }
}

6. Get UTCP Examples

Get ready-to-use example UTCP manuals:

{
  "tool": "get_utcp_examples",
  "arguments": {
    "use_case": "weather"  // weather, github, database, cli-tool
  }
}

Available Examples:

  • weather - OpenWeatherMap API integration
  • github - GitHub REST API (repos, issues)
  • database - Database query tools via MCP
  • cli-tool - Git command-line wrapper

7. Get Best Practices

Get UTCP implementation best practices:

{
  "tool": "get_best_practices",
  "arguments": {
    "topic": "naming"  // naming, authentication, error-handling, testing, general
  }
}

📖 Resources

The server provides these resources via MCP:

Resource URI Description
utcp://docs/full Complete UTCP documentation (9700+ lines)
utcp://docs/introduction UTCP introduction and overview
utcp://docs/protocols All protocol documentation
utcp://examples/weather Weather API example manual
utcp://examples/github GitHub API example manual
utcp://schema/manual UTCP JSON Schema for validation

🧪 Usage Examples

Example 1: Creating a New UTCP Manual

// 1. Generate a template
const result = await callTool("generate_utcp_manual", {
  tool_name: "send_email",
  description: "Send an email via SendGrid API",
  protocol: "http",
  endpoint: "https://api.sendgrid.com/v3/mail/send",
  method: "POST",
  parameters: {
    to: { type: "string", description: "Recipient email", required: true },
    subject: { type: "string", description: "Email subject", required: true },
    body: { type: "string", description: "Email body", required: true }
  },
  include_auth: true
});

// 2. Validate the generated manual
const validation = await callTool("validate_utcp_manual", {
  manual: JSON.parse(result)
});

// 3. Get best practices for authentication
const practices = await callTool("get_best_practices", {
  topic: "authentication"
});

Example 2: Converting Existing OpenAPI Spec

// 1. Read your OpenAPI spec
const openApiSpec = JSON.parse(fs.readFileSync("api-spec.json"));

// 2. Convert to UTCP
const utcpManual = await callTool("convert_openapi_to_utcp", {
  openapi_spec: openApiSpec
});

// 3. Validate the result
const validation = await callTool("validate_utcp_manual", {
  manual: JSON.parse(utcpManual)
});

Example 3: Searching Documentation

// Search for specific implementation details
const results = await callTool("search_utcp_docs", {
  query: "how to handle streaming responses",
  section: "protocols",
  limit: 3
});

// Get an example to reference
const example = await callTool("get_utcp_examples", {
  use_case: "github"
});

🏗️ Development

Setup

# Clone repository
git clone https://github.com/yourusername/utcp-docs-mcp-server.git
cd utcp-docs-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run in development mode
npm run dev

Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

Project Structure

utcp-docs/
├── src/
│   ├── index.ts              # Entry point
│   ├── server.ts             # MCP server implementation
│   ├── types/
│   │   └── utcp.ts           # TypeScript types
│   ├── services/
│   │   ├── documentation.ts  # Documentation search
│   │   ├── validator.ts      # UTCP validation
│   │   ├── generator.ts      # Manual generation
│   │   └── converter.ts      # OpenAPI conversion
│   └── schemas/
│       └── utcp-manual.schema.json
├── docs/
│   └── examples/             # Example UTCP manuals
├── tests/
│   └── services/             # Unit tests
├── llms.txt                  # Complete UTCP documentation
└── package.json

📋 Requirements

  • Node.js: 20.x or higher
  • TypeScript: 5.3 or higher
  • MCP SDK: 1.0.4 or higher

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Write tests for new features
  • Follow TypeScript best practices
  • Update documentation for API changes
  • Ensure all tests pass before submitting PR

📚 Resources

UTCP Resources

MCP Resources

🐛 Troubleshooting

Server Not Starting

Issue: Error: Cannot find module 'ajv-formats'

Solution:

npm install ajv-formats
npm run build

Documentation Not Loading

Issue: Error loading llms.txt

Solution: Ensure DOCS_PATH environment variable points to the correct directory:

export DOCS_PATH=/path/to/utcp-docs

Validation Errors

Issue: Tool names failing validation

Solution: Use snake_case naming:

  • get_user_data
  • GetUserData
  • getUserData

📄 License

MIT License - see LICENSE file for details

🙏 Acknowledgments

  • UTCP Team for creating the Universal Tool Calling Protocol
  • Anthropic for the Model Context Protocol
  • All contributors to this project

📞 Support


Built with ❤️ for the AI development community

Making UTCP implementation easier, one tool at a time.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选