@shvmgpt/openapi-mcp-server
v1.0.36
Published
An MCP server that exposes OpenAPI endpoints as resources
Readme
OpenAPI MCP Server
About
A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP resources. This server allows Large Language Models to discover and interact with APIs defined by OpenAPI specifications through the MCP protocol.
This repository provides access to the APIs available at API.market. The tool is free to use and allows agents to communicate freely with all available APIs, making it super powerful. With over 200+ APIs available at API.market, you can leverage a wide range of functionalities.
Quick Start
You do not need to clone this repository to use this MCP server. You can simply configure it in your client of choice.
For Claude Desktop
Locate or create your Claude Desktop configuration file:
- On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- On macOS:
Add the following configuration to enable the OpenAPI MCP server:
{ "mcpServers": { "openapi": { "command": "npx", "args": ["-y", "@shvmgpt/openapi-mcp-server"], "env": { "API_HEADERS": "X-magicapi-key:your-api-key,Accept:application/json" } } } }Replace the environment variables with your actual API configuration:
API_BASE_URL: The base URL of your API (optional)OPENAPI_SPEC_PATH: URL or path to your OpenAPI specification (optional) -API_HEADERS: Comma-separated key:value pairs for API authentication headers
For Cursor
Go to File -> Preferences -> Cursor Settings.
Select MCP.
Click on Add New MCP Server.
Paste the following command.
npx -y @shvmgpt/openapi-mcp-server --headers x-magicapi-key:your-api-key,Accept:application/json
Getting API Key from API.market
To obtain your API key
- Log in to https://api.market/
- Go to your profile and select 'My API Keys'
- Your API keys will be displayed here
List of APIs in this MCP
- GET-trueway-matrix-MatrixService-CalculateDrivingMatrix
- GET-magicapi-whisper-predictions--request_id
- POST-magicapi-whisper-whisper
- POST-capix-faceswap-upload
- POST-capix-faceswap-faceswap-v1-image POST-capix-faceswap-faceswap-v1-video
- POST-capix-faceswap-result
- GET-trueway-geocoding-GeocodingService-Geocode
- GET-trueway-geocoding-GeocodingService-ReverseGeocode
- POST-magicapi-dnschecker-dnschecker
- GET-magicapi-coder-predictions--request_id
- POST-magicapi-coder-coder
- POST-bridgeml-nsfw-detection-nsfw_detection
- GET-magicapi-whois-whois--domain-
- GET-magicapi-deblurer-predictions--request_id
- POST-magicapi-deblurer-deblurer
- POST-bridgeml-text-to-image-text_to_image
- GET-magicapi-period-predictions--request_id
- POST-magicapi-period-period
- GET-trueway-places-PlacesService-FindPlaceByText
- GET-trueway-places-PlacesService-FindPlacesNearby
- GET-magicapi-hair-predictions--request_id
- POST-magicapi-hair-hair
- POST-bridgeml-codellama-bridgeml-codellama
- GET-brave-brave-videos-search
- GET-brave-brave-web-search GET-brave-brave-images-search
- GET-brave-brave-news-search GET-brave-brave-suggest-search GET-brave-brave-spellcheck-search
- POST-magicapi-domainchecker-check_domains
- GET-trueway-routing-DirectionsService-FindDrivingRoute
- GET-trueway-routing-DirectionsService-FindDrivingPath
- POST-pipfeed-parse-extract
Example and Usage
Example 1
We can use the agent to find route between any two points

Example 2
We can use the agent to find news about any topic, and then dig deeper into the articles

Example 3
We can use the agent to look for available domains

Development Tools
Building
npm run build- Builds the TypeScript source.npm run clean- Removes build artifacts.npm run typecheck- Runs TypeScript type checking.
Development Mode
npm run dev- Watches source files and rebuilds on changes.npm run inspect-watch- Runs the inspector with auto-reload on changes.
Code Quality
npm run lint- Runs ESLint.npm run typecheck- Verifies TypeScript types.
Adding Your Own API to the MCP Server
To add your own API, ensure it is an OpenAPI formatted API. Follow these steps:
- Create a new folder for your API.
- Clone this repository:
git clone https://github.com/your-username/repo-name.git- Change into your folder:
cd your-folderIn the folder named
json_files, add your OpenAPI specification. Before running the Node commands, please follow these steps:Run modify_api.py:
- Execute the
modify_api.pyscript with the directory set to the folder containing the JSON files. This will:- Create a new folder named
modified_json_filesinside the folder with the JSON files. - Generate a file named
modified_files.txtthat lists all the modified files.
- Create a new folder named
- Run shorten_summary_in_specs:
- Add your
x-magicapi-keyas an environment variable. - Run the Python script.
- Alternatively, you can use
manual_summary_shortner.pyto shorten the summaries manually.
- Publish your package using npm:
npm publish --access publicConfiguration
The server can be configured through environment variables or command line arguments:
Environment Variables
API_BASE_URL- Base URL for the API endpoints.OPENAPI_SPEC_PATH- Path or URL to the OpenAPI specification.API_HEADERS- Comma-separated key:value pairs for API headers.SERVER_NAME- Name for the MCP server (default: "mcp-openapi-server").SERVER_VERSION- Version of the server (default: "1.0.0").
Set Environment Variables:
Configure your environment by running the following commands:
export OPENAPI_SPEC_PATH=modified_files.txt # optional
export API_BASE_URL=https://api.magicapi.dev/api/v1/ # optional
export API_HEADERS="x-magicapi-key:your-api-key,Accept:application/json"Command Line Arguments
npm run inspect -- \
--api-base-url https://api.magicapi.dev/api/v1/ \
--openapi-spec modified_files.txt \
--headers "x-magicapi-key:your-api-key,Accept:application/json" \
--name "my-mcp-server" \
--version "1.0.0"Development Workflow
- Start the development environment:
npm run inspect-watch- Make changes to the TypeScript files in
src/. - The server will automatically rebuild and restart.
- Use the MCP Inspector UI to test your changes.
Debugging or Running Locally
To debug or run the MCP server locally:
- Clone the repository and install dependencies:
git clone https://github.com/your-username/repo-name.git
cd repo-name
npm install- build the server:
npm run build- For debugging, you can run:
npm run inspect Contributing
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Run tests and linting:
npm run typecheck
npm run lint- Submit a pull request.
License
MIT
