MCP Server Generator logo

MCP Server Generator

by jmcentire

This Python-based CLI tool automates the creation of an MCP server from a given API specification. By parsing an OpenAPI or GraphQL specification, it generates a fully functional MCP server project that adheres to Anthropic's best practices and integrates with the official MCP SDK.

View on GitHub

Last updated: N/A

What is MCP Server Generator?

The MCP Server Generator is a Python-based CLI tool designed to streamline the creation of Model Context Protocol (MCP) servers. It automates the process of generating server code from API specifications (OpenAPI or GraphQL), incorporating security and privacy best practices, and integrating with the Anthropic MCP SDK.

How to use MCP Server Generator?

To use the tool, you need to provide an API specification file (OpenAPI or GraphQL) and a JSON configuration file specifying the output language (Python, TypeScript, Kotlin, or Rust), desired privacy settings, authentication method, and security measures. The tool then parses the specification, generates the server project in the specified language, and outputs it to a designated directory.

Key features of MCP Server Generator

  • Automated MCP server generation from API specifications

  • Support for OpenAPI and GraphQL specifications

  • Integration with Anthropic MCP SDK

  • Configurable security and privacy measures (field redaction, rate limiting, secure headers)

  • Support for multiple output languages (Python, TypeScript, Kotlin, Rust)

Use cases of MCP Server Generator

  • Rapidly create MCP servers for exposing data sources to AI assistants

  • Securely connect AI systems with data sources using standardized protocols

  • Automate the implementation of security and privacy best practices in MCP servers

  • Generate server code in multiple languages from a single API specification

FAQ from MCP Server Generator

What API specification formats are supported?

The tool supports both OpenAPI (YAML/JSON) and GraphQL (SDL/IDL) specifications.

What output languages are supported?

The tool can generate MCP server projects in Python, TypeScript, Kotlin, and Rust.

How are security and privacy measures implemented?

The tool implements configurable security and privacy measures through middleware, including field redaction, rate limiting, secure headers, and compliance settings.

What authentication methods are supported?

The tool supports OAuth 2.0 and API Key authentication methods, generating middleware hooks for custom logic implementation.

How do I customize the generated server?

The generated project includes a structured README with instructions for setup, usage, and customization. The generated code also contains TODO comments indicating where to implement custom logic.

MCP Server Generator - MCP Server | MCP Directory