@mcp-apps/api-tools-mcp-server v1.0.36
API Tools MCP Server
An MCP (Model Context Protocol) server that provides tools for API integration and web service interaction.
Fe### Getting OpenAPI Endpoints
List all the endpoints available in the Petstore API at https://petstore.swagger.io/v2/swagger.jsonUsing OpenAPI Auto-Discovery
Get the OpenAPI schema for the Petstore API at https://petstore.swagger.ioThis example uses auto-discovery to find and retrieve the schema without needing the exact path.s
- API Integration: Tools for making API calls to various services with authentication
- OpenAPI Support: Parse and inspect OpenAPI specifications
- OpenAPI Auto-Discovery: Automatically locate OpenAPI schemas even when only given a base API URL
- Authentication: Multiple authentication methods including Bearer token, Basic auth, and Interactive authentication
- Request Generation: Generate API requests based on specifications
- Schema Inspection: Fetch OpenAPI schemas, list endpoints, and explore API operations
- Error Handling: Comprehensive error handling with retries for transient failures
Setup Instructions
Prerequisites
- VS Code (latest version recommended)
- Node.js 18.0 or higher
- npm 8.0 or higher
Local Development Setup
Clone the repository:
git clone https://github.com/your-repo/api-tools-mcp-server.git cd api-tools-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildRun the server:
npm startFor development with auto-reload:
npm run watchTo run tests:
npm run test:api npm run test:openapi
Using with GitHub Copilot in VS Code
Installation with GitHub Copilot UI
- Ensure you have the GitHub Copilot extension installed in VS Code
- If not, open VS Code Extensions view (Ctrl+Shift+X)
- Search for "GitHub Copilot"
- Click "Install"
- Open VS Code and the GitHub Copilot Chat panel
- Use the keyboard shortcut (Ctrl+Shift+I) or
- Click on the Copilot Chat icon in the activity bar
Select "Agent Mode" in the Copilot Chat panel.
Click on the "Tools" icon and select Add More Tools.
Click Add MCP Server tool.
Choose Command (stdio) as the tool type.
Type the following command to install and run the API Tools MCP server:
npx @mcp-apps/api-tools-mcp-serverOnce set up, Copilot will be able to assist with API integration and calls.
Available Tools
API Integration Tools
call_api- Makes authenticated API calls to a specified endpoint- Parameters:
endpoint: The base URL of the API endpointmethod: HTTP method (GET, POST, PUT, PATCH, DELETE)path(optional): Path to append to the endpoint URLqueryParams(optional): Query parameters to includeheaders(optional): Headers to includebody(optional): Body data to include in the requestauthType: Authentication method ('bearer', 'basic', 'interactive', 'none')authConfig(optional): Authentication configuration
- Parameters:
call_api_advanced- Extended version with more authentication options- Additional parameters:
authType: Includes 'msal' and 'azure-identity' optionstimeout: Request timeout in millisecondsretryCount: Number of retries for transient errors
- Additional parameters:
fetch_openapi_schema- Fetches and parses an OpenAPI schema from a URL- Parameters:
schemaUrl: URL where the OpenAPI schema is published or API base URL (auto-discovery enabled)authType(optional): Authentication method if the schema requires authauthConfig(optional): Authentication configuration object
Auto-Discovery Feature:
If the exact URL doesn't contain a valid OpenAPI schema, the tool will automatically try common schema endpoints (like "/swagger.json", "/v2/swagger.json", "/openapi.json", "/api-docs.json") to locate the schema. This enables you to just provide the base URL of an API and let the tool find the schema for you.
See OpenAPI Auto-Discovery Documentation for details.
- Parameters:
get_openapi_endpoints- Lists all available endpoints from an OpenAPI schema- Parameters:
schemaUrl: URL where the OpenAPI schema is publishedauthType(optional): Authentication method if the schema requires authauthConfig(optional): Authentication configuration object
- Parameters:
get_openapi_operations- Gets detailed information about operations for a specific endpoint- Parameters:
schemaUrl: URL where the OpenAPI schema is publishedpath: The specific API path to get operations for (e.g., "/pets")authType(optional): Authentication method if the schema requires authauthConfig(optional): Authentication configuration object
- Parameters:
get_openapi_operation_details- Gets comprehensive details about a specific operation (by operationId)- Parameters:
schemaUrl: URL where the OpenAPI schema is publishedoperationId: The operation ID to retrieve details for (e.g., "getPetById")authType(optional): Authentication method if the schema requires authauthConfig(optional): Authentication configuration object
- Parameters:
Example Usage
Here are examples of using the API Tools MCP Server with GitHub Copilot:
Making a Simple API Call
Call the Weather API at https://api.weather.com/forecast with my API key abc123Making an Authenticated API Call
Make a POST request to https://api.example.com/data with bearer token authenticationWorking with OpenAPI Specifications
Get the available operations from the Petstore API specification at https://petstore.swagger.io/v2/swagger.jsonFetching an OpenAPI Schema
Fetch the complete OpenAPI schema from https://petstore.swagger.io/v2/swagger.jsonListing OpenAPI Endpoints
List all the endpoints available in the Petstore API at https://petstore.swagger.io/v2/swagger.jsonGetting Endpoint Operations
Show me all the operations available for the /pet endpoint in the Petstore APIGetting Operation Details by ID
Get details for the getPetById operation in the Petstore API and show me a sample requestGenerating an API Call Template
Generate a template for the 'addPet' operation from the Petstore APIAdvanced Authentication
Call the Microsoft Graph API with MSAL authentication to retrieve my profile informationInteractive Browser Authentication
Log me in using device code authentication to call the Microsoft Graph APISecurity Considerations
- This server handles API keys and authentication tokens with appropriate security measures
- All sensitive data is properly handled and not logged or exposed
- Implements standard security practices for API communication
- Authentication token refresh is managed securely
- Consider additional security measures depending on your specific API integration requirements
License
ISC
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago