AutoMCP
by beaukuhn
AutoMCP is a code generator for the Model Context Protocol that automatically creates server and client code based on YAML service definitions. It simplifies the development of MCP-compatible services.
Last updated: N/A
What is AutoMCP?
AutoMCP is a tool that generates server and client code for the Model Context Protocol (MCP) from YAML service definitions. It automates the creation of boilerplate code, allowing developers to focus on implementing the core logic of their services.
How to use AutoMCP?
To use AutoMCP, you define your service in a YAML file, specifying the service name, version, description, tools, parameters, and return types. Then, you run the generator script (./bin/automcp.sh generate
) to create server code, client code, and handler stubs. Finally, you implement the tool functionality in the generated handler files.
Key features of AutoMCP
Generates MCP-compatible server code
Generates client libraries for easy service consumption
Creates handler stubs for implementing tool functionality
Organizes code by service in dedicated directories
Use cases of AutoMCP
Developing agentic workflows using MCP
Creating microservices that communicate using MCP
Building tools that integrate with MCP-based platforms
Automating the generation of MCP service code
FAQ from AutoMCP
What is the Model Context Protocol (MCP)?
What is the Model Context Protocol (MCP)?
The README suggests referring to MCP Agent to understand how this is used in agentic workflows.
What are the prerequisites for using AutoMCP?
What are the prerequisites for using AutoMCP?
You need Node.js 18 or higher and npm or yarn installed.
How do I define a service?
How do I define a service?
Create a YAML file in the services/[service-name]/
directory with the specified structure.
How do I generate the code?
How do I generate the code?
Run the generator script: ./bin/automcp.sh generate
.
Where are the generated files located?
Where are the generated files located?
Server code is in generated/[service-name]/[service-name]_server.ts
, client code is in generated/[service-name]/[service-name]_client.ts
, and handler stubs are in src/custom/[service-name]/[tool-name]Handlers.ts
.