MCPConvert is a hosted web service that converts Swagger/OpenAPI documents to MCP JSON format. It provides a simple, low-friction way to generate MCP contexts from existing API documentation.
- Unified Conversion Interface: Upload Swagger files or provide URLs to Swagger documents
- Source Mapping: Optional mapping between MCP elements and Swagger source
- Diagnostic Mode: Detailed information about the conversion process
- Caching: Efficient caching of conversion results for improved performance
- Usage Tracking: Monitor API usage and enforce quotas
- MCP Context Endpoint: Built-in
.well-known/mcp-context
endpoint using MCPBuckle - Resource Efficient: Optimized for Azure Free Tier deployment
- Visit the conversion page
- Enter a Swagger URL or upload a Swagger file
- Optionally enable source mapping and diagnostic mode
- Click "Convert" to generate the MCP JSON
- View the results or download the MCP JSON file
MCPConvert can be integrated with other tools and services:
// Example C# client code
using var httpClient = new HttpClient();
var content = new MultipartFormDataContent();
// Option 1: Convert from URL
content.Add(new StringContent(swaggerUrl), "SwaggerUrl");
// Option 2: Convert from file
content.Add(new StreamContent(fileStream), "SwaggerFile", "swagger.json");
// Optional flags
content.Add(new StringContent("true"), "IncludeSourceMapping");
content.Add(new StringContent("true"), "DiagnosticMode");
var response = await httpClient.PostAsync("https://mcpconvert.example.com/Convert", content);
var result = await response.Content.ReadAsStringAsync();
MCPConvert is designed to be easily integrated with AI agents and IDEs:
- The
.well-known/mcp-context
endpoint provides the MCP context for the converter itself - Source mapping enables traceability between MCP elements and Swagger source
- Content hashing ensures idempotency for caching and change detection
- Diagnostic mode provides detailed information for troubleshooting
For command-line usage, you can use curl:
# Convert from URL
curl -X POST https://mcpconvert-h3bwarf4e3e7aabv.westus2-01.azurewebsites.net/Convert \
-F "SwaggerUrl=https://petstore.swagger.io/v2/swagger.json" \
-F "IncludeSourceMapping=true" \
-F "DiagnosticMode=true"
# Convert from file
curl -X POST https://mcpconvert-h3bwarf4e3e7aabv.westus2-01.azurewebsites.net/Convert \
-F "SwaggerFile=@/path/to/swagger.json" \
-F "IncludeSourceMapping=true" \
-F "DiagnosticMode=true"
- .NET 9.0 SDK
- Visual Studio 2022 or Visual Studio Code
# Clone the repository
git clone https://github.com/grparry/MCPConvert.git
cd MCPConvert
# Build the project
dotnet build
# Run the application
dotnet run
- MCPBuckle: MCP context generation for ASP.NET Core
- Microsoft.OpenApi: OpenAPI document parsing and manipulation
- Newtonsoft.Json: JSON serialization and manipulation
This project is open source and available under the MIT License.