Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดThis tool generates Model Context Protocol (MCP) servers from OpenAPI specifications, creating Python packages that can be used by AI assistants to interact with APIs. The core architecture transforms OpenAPI specs into structured MCP servers with tools, models, and client code.
uvx --from git+https://github.com/cnoe-io/openapi-mcp-codegen.git openapi_mcp_codegen \
--spec-file examples/petstore/openapi_petstore.json \
--output-dir examples/petstore \
--generate-agent \
--generate-eval
pyproject.toml, .env.example)# Setup venv
uv venv && source .venv/bin/activate
# Initial setup (requires uv CLI)
uv sync
flowchart TD
subgraph Client Layer
A[User Client A2A]
end
subgraph Agent Transport Layer
B[Google A2A]
end
subgraph Agent Framework Layer
C[LangGraph ReAct Agent]
end
subgraph Tools/MCP Layer
D[Petstore MCP Server]
E[Petstore API Server]
end
A --> B
B --> C
C -.-> D
D -.-> C
D -.-> E
E -.-> D
The generated architecture includes an MCP server in STDIO mode and two built-in utility tools: get_current_time and iso8601_to_unix.
uvx --from git+https://github.com/cnoe-io/openapi-mcp-codegen.git openapi_mcp_codegen \
--spec-file examples/petstore/openapi_petstore.json \
--output-dir examples/petstore \
--generate-agent \
--generate-eval
cat > .env << 'EOF'
# Petstore API
PETSTORE_API_URL=http://0.0.0.0:10000
PETSTORE_TOKEN=foo
# LLM provider (configure per your provider)
LLM_PROVIDER=openai
OPENAI_API_KEY=<your-openai-api-key>
OPENAI_ENDPOINT=https://api.openai.com/v1
OPENAI_MODEL_NAME=gpt-5
# Langfuse (optional)
LANGFUSE_HOST=http://localhost:3000
LANGFUSE_PUBLIC_KEY=<your-langfuse-public-key>
LANGFUSE_SECRET_KEY=<your-langfuse-secret-key>
EOF
Also export the variables into your shell:
# Exports each line of the .env ignoring lines starting with #
export $(grep -v '^#' .env | xargs)
cd examples/petstore
uv run python petstore_mock_server.py
cd examples/petstore
make run-a2a
cd examples/petstore
make run-a2a-client
You now have an agent and client deployed, e.g. ask List my available pets. You can see tracing in LangFuse (http://localhost:3000) if enabled. Follow the next steps to evaluate your agent:
eval/dataset.yamlmake run-a2a-eval-mode
make eval
This creates a new dataset in LangFuse and triggers an evaluation run.
This section requires host.docker.internal to be accessible. See this GitHub issue if you encounter any problems.
export PETSTORE_API_URL=http://host.docker.internal:10000 # Needed so that the MCP server can talk to the mock API server running on the host
make run-a2a-and-slim
This docker-compose:
host.docker.internal is accessible, alternatively add the langfuse components to the generate docker-compose file and update the LANGFUSE_HOST environment variable to http://langfuse-web:3000).make run-slim-client
The A2A Inspector is a utility for inspecting and debugging A2A servers. It provides a visual interface to explore agent cards and invoke the agent. Follow the instructions on the project page to build and run the inspector, which should be available at localhost:8080. You can then connect to the agent running on localhost:8000/.well-known/agent.json.
config.yaml with metadata such as authorization headerspyproject.toml includes agent-specific dependencies.env.example templates include agent-specific environment variablesasync def operation_id(params) -> Anyhttpx with configurable base URLs and headersmcp>=1.9.0 for FastMCP server implementationopenapi_mcp_codegen/mcp_codegen.py: Core generation logic and template renderingopenapi_mcp_codegen/templates/: Template structure mirrors output structureexamples/petstore/: Complete working example with OpenAPI spec and configtests/test_mcp_codegen.py: Integration tests showing expected generation flowUse --enable-slim to build an agent that can run its A2A server over the SLIM transport.
--enable-slim, docker-compose also brings up a slim-dataplane service and connects the agent over SLIM.AgntcyFactory.make run-a2a-and-slim to start both HTTP A2A and the SLIM bridge stack, including the slim-dataplane.make run-slim-client
--with-a2a-proxy flag
make run-with-proxy) to start the WS upstream locally.render_template()--dry-run flag to preview generation without writing filesThis tool now supports LLM-enhanced documentation using the OpenAPI Overlay Specification 1.0.0. Generate AI-friendly MCP servers with optimized docstrings for better agent comprehension.
# One-command enhanced MCP server generation
python -m openapi_mcp_codegen.enhance_and_generate \
examples/argo-workflows/openapi_argo_workflows.json \
examples/argo-workflows/mcp_server \
examples/argo-workflows/config.yaml \
--save-overlay overlay.yaml \
--save-enhanced-spec enhanced_openapi.json
This command will:
flowchart LR
A[OpenAPI Spec] -->|1. Analyze| B[Overlay Generator]
B -->|2. LLM Enhance| C[overlay.yaml]
A -->|3. Apply| D[Overlay Applier]
C --> D
D -->|4. Enhanced| E[enhanced_openapi.json]
E -->|5. Generate| F[MCP Server]
style B fill:#e1f5ff
style C fill:#fff4e6
style E fill:#e8f5e9
style F fill:#f3e5f5
The title field in config.yaml now controls the package name:
title: argo_workflows # → mcp_argo_workflows
description: Argo Workflows MCP Server
author: Your Name
email: [email protected]
version: 0.1.0
license: Apache-2.0
headers:
Authorization: Bearer {token}
Accept: application/json
# Generate overlay only (with LLM)
python -m openapi_mcp_codegen.overlay_generator \
spec.json overlay.yaml --use-llm
# Apply existing overlay
python -m openapi_mcp_codegen.overlay_applier \
spec.json overlay.yaml enhanced_spec.json
# Full pipeline
python -m openapi_mcp_codegen.enhance_and_generate \
spec.json output/ config.yaml \
--save-overlay overlay.yaml \
--format yaml
GET /api/v1/workflows:
description: "Get workflows"
GET /api/v1/workflows:
description: "List all workflows in a namespace. Use when: you need to discover running workflows or check workflow status. Required: namespace"
async def workflow_service_list_workflows(
path_namespace: str,
param_listOptions_labelSelector: str = None
) -> Any:
"""
List all workflows in a namespace
OpenAPI Description:
List all workflows in a namespace. Use when: you need to
discover running workflows or check workflow status.
Args:
path_namespace (str): Kubernetes namespace to scope the operation
param_listOptions_labelSelector (str): Filter by labels
"""
Store in version control:
openapi.json - Original OpenAPI specconfig.yaml - Configurationoverlay.yaml - Optional (can regenerate, but useful for review/edits)Auto-generated (don't store):
enhanced_openapi.json - Derived from original + overlaymcp_server/ - Generated code output# Set LLM API keys
export OPENAI_API_KEY=your-key
export ANTHROPIC_API_KEY=your-key
export LLM_PROVIDER=openai # or anthropic
# The overlay generator will automatically use LLM if keys are set
# Falls back to rule-based generation if no LLM available
You can manually edit overlay.yaml for fine-tuned control:
overlay: 1.0.0
info:
title: Custom Enhancements
version: 1.0.0
actions:
- target: $.paths['/api/v1/workflows'].get.description
update: "Your custom description here"
- target: $.paths['/api/v1/workflows'].get.parameters[0].description
update: "Custom parameter description"
Then apply and regenerate:
python -m openapi_mcp_codegen.overlay_applier \
original_spec.json overlay.yaml enhanced_spec.json
python -m openapi_mcp_codegen \
--spec-file enhanced_spec.json \
--output-dir mcp_server
examples/ directory for complete working examplesOpenAPI to MCP Server Code Generator
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Openapi MCP Codegen ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-05 OpenAPI to MCP Server Code Generator