Skip to main content
Glama
fikri2992

MCP API Server

by fikri2992

MCP Builder CLI

A command-line interface for generating Model Context Protocol (MCP) servers from API specifications. This package provides two separate tools:

  1. MCP Builder CLI (mcp-builder) - Generate custom MCP servers from API specification documents

  2. MCP API Server (mcp-api-server) - Make HTTP requests from AI assistants like Claude

What is this for?

This package contains two distinct tools that serve different purposes:

MCP Builder CLI (mcp-builder)

Generate custom MCP servers from API specification documents. This tool helps developers create MCP servers tailored to specific APIs.

MCP API Server (mcp-api-server)

Allow AI assistants like Claude to make HTTP requests (GET, POST, PUT, DELETE) to any web API directly. This acts as a bridge between AI assistants and web APIs, enabling them to:

  • Fetch data from REST APIs

  • Send data to web services

  • Interact with online tools and platforms

For example, you could ask Claude to check the weather by making a request to a weather API, or ask it to shorten a URL using a URL shortening service.

Related MCP server: OpenAPI MCP Server

Quickstart Guide

1. Using the Built-in API Server with Claude Desktop (Easiest)

First, configure Claude Desktop to use the built-in MCP API server:

  1. Open Claude Desktop

  2. Go to the MCP configuration file (usually located at ~/.config/claude/claude_desktop_config.json on Mac/Linux or %APPDATA%/Claude/claude_desktop_config.json on Windows)

  3. Add this server configuration:

{
  "mcpServers": {
    "api-server": {
      "command": "npx",
      "args": ["mcp-api-server"]
    }
  }
}
  1. Restart Claude Desktop

  2. You can now use the API tools in Claude!

2. Running the API Server Directly

The easiest way to run the API server is using NPX (no installation required):

npx mcp-api-server

For development/testing, you might want to enable debug logging and allow localhost requests:

npx mcp-api-server --debug --allow-localhost

You can also run the server directly with Node:

node dist/src/index.js

With debug and localhost access:

node dist/src/index.js --debug --allow-localhost

3. Installing Globally

To install the tools globally on your system:

npm install -g mcp-builder

Then run the API server with:

mcp-api-server

4. Using with Claude

Once configured, you can ask Claude to make API requests:

"Can you get the latest news from https://api.example.com/news/latest?"

"Please post this data to my webhook: {"message": "Hello World"}"

Claude will automatically use the appropriate tool (api_get, api_post, etc.) based on what you're asking for.

Features

  • 🚀 HTTP API Tools: GET, POST, PUT, DELETE request support

  • 🔒 Security: Request validation with configurable security policies

  • 📝 Logging: Comprehensive debug logging and request tracking

  • ⚙️ Configurable: Flexible configuration via CLI args and environment variables

  • 🛡️ Error Handling: Robust error handling with detailed error messages

  • 🔄 Graceful Shutdown: Proper cleanup and shutdown handling

Installation

Run directly without installation:

npx mcp-builder

Global Installation

npm install -g mcp-builder
mcp-builder

Local Installation

npm install mcp-builder
npx mcp-builder

Usage

API Server Usage

# Start the API server
mcp-api-server

# Start with debug logging
mcp-api-server --debug

# Allow localhost requests (useful for development)
mcp-api-server --allow-localhost

# Allow private IP requests
mcp-api-server --allow-private-ips

# Show help
mcp-api-server --help

You can also run the API server directly with Node:

# Start the API server directly
node dist/src/index.js

# Start with debug logging
node dist/src/index.js --debug

# Allow localhost requests
node dist/src/index.js --allow-localhost

# Allow private IP requests
node dist/src/index.js --allow-private-ips

# Show help
node dist/src/index.js --help

Environment Variables

Configure the API server using environment variables:

# Server Configuration
API_TIMEOUT=60000          # Request timeout in milliseconds
ALLOW_LOCALHOST=true      # Allow requests to localhost (127.0.0.1)
ALLOW_PRIVATE_IPS=false   # Allow requests to private IP ranges
MAX_RESPONSE_LENGTH=100000 # Maximum response length in bytes
USER_AGENT="MyApp/1.0.0"   # Custom user agent string for requests

# Debug Configuration
DEBUG=true                # Enable detailed logging

MCP Builder CLI Usage

The MCP Builder CLI is used to generate custom MCP servers from API specification documents:

# Generate an MCP server from an API specification
mcp-builder generate <api-spec.md> <output-directory>

# Validate an API specification file
mcp-builder validate <api-spec.md>

# Show help
mcp-builder --help

# Show help for a specific command
mcp-builder help generate

Configuration Options

CLI Option

Environment Variable

Default

Description

--debug

DEBUG

false

Enable debug logging

--allow-localhost

ALLOW_LOCALHOST

false

Allow requests to localhost

--allow-private-ips

ALLOW_PRIVATE_IPS

false

Allow requests to private IPs

N/A

API_TIMEOUT

30000

Request timeout in milliseconds

N/A

MAX_RESPONSE_LENGTH

50000

Maximum response length in bytes

N/A

USER_AGENT

MCP-API-Server/1.0.0

Custom user agent string

Available Tools

The API server provides the following MCP tools that Claude or other MCP clients can use:

api_get

Make an HTTP GET request to retrieve data from a URL.

Parameters:

  • url (string): The URL to request data from

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Can you fetch the JSON data from https://api.example.com/users?"

api_post

Make an HTTP POST request to send data to a URL.

Parameters:

  • url (string): The URL to send data to

  • body (string or object, optional): The data to send

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Please post this JSON to my webhook: {"name": "John", "age": 30}"

api_put

Make an HTTP PUT request to update data at a URL.

Parameters:

  • url (string): The URL to update data at

  • body (string or object, optional): The updated data

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Update my user profile with this data: {"name": "John Smith", "age": 31}"

api_delete

Make an HTTP DELETE request to remove data at a URL.

Parameters:

  • url (string): The URL to delete data from

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Please delete the user with ID 123 from https://api.example.com/users/123"

MCP Client Configuration

To use this server with an MCP client, add it to your MCP configuration:

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "api-server": {
      "command": "npx",
      "args": ["mcp-api-server"]
    }
  }
}

With Custom Configuration

{
  "mcpServers": {
    "api-server": {
      "command": "npx",
      "args": ["mcp-api-server", "--debug", "--allow-localhost"]
    }
  }
}

You can also run the server directly with Node:

{
  "mcpServers": {
    "api-server": {
      "command": "node",
      "args": ["dist/src/index.js", "--debug", "--allow-localhost"]
    }
  }
}

Security Considerations

  • By default, requests to localhost and private IP ranges are blocked to prevent SSRF attacks

  • Only enable --allow-localhost and --allow-private-ips in trusted environments

  • The server validates all requests and sanitizes responses

  • Request timeouts prevent hanging connections

  • Response size limits prevent memory exhaustion

Error Handling

The server provides detailed error messages for:

  • Invalid URLs

  • Network timeouts

  • JSON parsing errors

  • Validation failures

  • HTTP errors

All errors are logged with timestamps and context for debugging.

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

Support

Installation

Run directly without installation:

npx mcp-builder

Global Installation

npm install -g mcp-builder
mcp-builder

Local Installation

npm install mcp-builder
npx mcp-builder

Usage

Basic Usage

# Start the server
mcp-api-server

# Start with debug logging
mcp-api-server --debug

# Allow localhost requests (useful for development)
mcp-api-server --allow-localhost

# Allow private IP requests
mcp-api-server --allow-private-ips

# Show help
mcp-api-server --help

You can also run the server directly with Node:

# Start the server
node dist/src/index.js

# Start with debug logging
node dist/src/index.js --debug

# Allow localhost requests
node dist/src/index.js --allow-localhost

# Allow private IP requests
node dist/src/index.js --allow-private-ips

# Show help
node dist/src/index.js --help

Environment Variables

Configure the server using environment variables:

# Server Configuration
API_TIMEOUT=60000          # Request timeout in milliseconds
ALLOW_LOCALHOST=true      # Allow requests to localhost (127.0.0.1)
ALLOW_PRIVATE_IPS=false   # Allow requests to private IP ranges
MAX_RESPONSE_LENGTH=100000 # Maximum response length in bytes
USER_AGENT="MyApp/1.0.0"   # Custom user agent string for requests

# Debug Configuration
DEBUG=true                # Enable detailed logging

Configuration Options

CLI Option

Environment Variable

Default

Description

--debug

DEBUG

false

Enable debug logging

--allow-localhost

ALLOW_LOCALHOST

false

Allow requests to localhost

--allow-private-ips

ALLOW_PRIVATE_IPS

false

Allow requests to private IPs

N/A

API_TIMEOUT

30000

Request timeout in milliseconds

N/A

MAX_RESPONSE_LENGTH

50000

Maximum response length in bytes

N/A

USER_AGENT

MCP-API-Server/1.0.0

Custom user agent string

Available Tools

The server provides the following MCP tools that Claude or other MCP clients can use:

api_get

Make an HTTP GET request to retrieve data from a URL.

Parameters:

  • url (string): The URL to request data from

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Can you fetch the JSON data from https://api.example.com/users?"

api_post

Make an HTTP POST request to send data to a URL.

Parameters:

  • url (string): The URL to send data to

  • body (string or object, optional): The data to send

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Please post this JSON to my webhook: {"name": "John", "age": 30}"

api_put

Make an HTTP PUT request to update data at a URL.

Parameters:

  • url (string): The URL to update data at

  • body (string or object, optional): The updated data

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Update my user profile with this data: {"name": "John Smith", "age": 31}"

api_delete

Make an HTTP DELETE request to remove data at a URL.

Parameters:

  • url (string): The URL to delete data from

  • headers (object, optional): HTTP headers to include in the request

Example usage with Claude:

"Please delete the user with ID 123 from https://api.example.com/users/123"

MCP Client Configuration

To use this server with an MCP client, add it to your MCP configuration:

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "api-server": {
      "command": "npx",
      "args": ["mcp-api-server"]
    }
  }
}

With Custom Configuration

{
  "mcpServers": {
    "api-server": {
      "command": "npx",
      "args": ["mcp-api-server", "--debug", "--allow-localhost"]
    }
  }
}

Security Considerations

  • By default, requests to localhost and private IP ranges are blocked to prevent SSRF attacks

  • Only enable --allow-localhost and --allow-private-ips in trusted environments

  • The server validates all requests and sanitizes responses

  • Request timeouts prevent hanging connections

  • Response size limits prevent memory exhaustion

Error Handling

The server provides detailed error messages for:

  • Invalid URLs

  • Network timeouts

  • JSON parsing errors

  • Validation failures

  • HTTP errors

All errors are logged with timestamps and context for debugging.

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

Support

Available Tools

4 tools
api_deleteC

Make an HTTP DELETE request to the specified URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the DELETE request to
headersNoOptional headers to include in the request

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits such as authentication needs, rate limits, error handling, or what 'DELETE' implies (e.g., resource removal). It's minimal and lacks critical operational details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero waste, front-loaded with the core action. It's appropriately sized for the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that performs a potentially destructive HTTP DELETE operation, the description is incomplete. It fails to address key aspects like response format, error cases, or safety considerations, leaving significant gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'url' and 'headers' parameters fully. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Make an HTTP DELETE request') and target ('to the specified URL'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like api_get or api_post beyond the HTTP method, missing explicit sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like api_post or api_put for similar operations, nor does it mention any prerequisites or exclusions. It lacks context for selection among HTTP method tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

api_getC

Make an HTTP GET request to the specified URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the GET request to
headersNoOptional headers to include in the request

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks critical details: it doesn't mention authentication requirements, rate limits, error handling, response formats, or idempotency. For a general-purpose HTTP tool, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of an HTTP GET tool with no annotations and no output schema, the description is incomplete. It doesn't address key contextual aspects like expected response types, error scenarios, or integration with sibling tools, leaving the agent with insufficient information for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the schema fully documenting both parameters (url and headers). The description adds no additional parameter semantics beyond what the schema provides, such as example headers or URL constraints. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Make an HTTP GET request') and the target ('to the specified URL'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools (api_delete, api_post, api_put) beyond the HTTP method, missing explicit distinction about when to use GET versus other methods.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention typical use cases for GET requests (e.g., retrieving data, idempotent operations) or contrast with siblings for different HTTP methods, leaving the agent without contextual usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

api_postC

Make an HTTP POST request to the specified URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the POST request to
bodyNoThe request body (string or JSON object)
headersNoOptional headers to include in the request

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions making a POST request but doesn't describe potential side effects (e.g., data modification, authentication needs, rate limits, error handling, or response format). For a tool that performs HTTP operations with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of HTTP operations (with potential for side effects, authentication, and varied responses), no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, and what to expect from the response, which are crucial for an AI agent to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for all parameters (url, body, headers). The description adds no additional meaning beyond what the schema provides, such as examples or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Make an HTTP POST request') and target ('to the specified URL'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its siblings (api_delete, api_get, api_put) beyond the HTTP method, which is why it doesn't reach a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like api_put or api_get, nor does it mention any prerequisites or context for when POST requests are appropriate (e.g., for creating resources). It simply states what the tool does without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

api_putC

Make an HTTP PUT request to the specified URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the PUT request to
bodyNoThe request body (string or JSON object)
headersNoOptional headers to include in the request

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but does not cover critical traits like authentication requirements, rate limits, error handling, or whether the operation is idempotent (a key aspect of PUT). This leaves significant gaps for an agent to understand how to use the tool safely and effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero waste, clearly front-loading the purpose. It is appropriately sized for the tool's scope, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (HTTP PUT with potential side effects), lack of annotations, and no output schema, the description is incomplete. It fails to address behavioral aspects like idempotency, error responses, or typical usage patterns, leaving the agent with insufficient context for reliable invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents all parameters (url, body, headers) with descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but does not contradict it. Baseline score of 3 is appropriate as the schema handles the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Make an HTTP PUT request') and the resource ('to the specified URL'), distinguishing it from siblings like api_get or api_post by specifying the HTTP method. However, it does not explicitly differentiate from api_delete, which also targets a URL, making it slightly less specific than a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as api_post or api_delete, nor does it mention prerequisites like authentication or typical use cases for PUT requests (e.g., updating resources). It lacks explicit when/when-not instructions or context for selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedapi_delete
    • First observedapi_get
    • First observedapi_post
    • First observedapi_put

TDQS

A3.5/5.0
Disambiguation5/5

Each tool corresponds to a distinct HTTP method (DELETE, GET, POST, PUT), with no overlap in purpose. The descriptions clearly differentiate them by the type of request they make, eliminating any ambiguity.

Naming Consistency5/5

All tool names follow a consistent 'api_' prefix followed by the HTTP method in lowercase (e.g., api_delete, api_get). This pattern is uniform across all tools, making them predictable and easy to understand.

Tool Count5/5

With 4 tools covering the core HTTP methods (DELETE, GET, POST, PUT), the count is well-scoped for a general-purpose API server. Each tool serves a clear, essential function without redundancy.

Completeness5/5

The tool set provides complete coverage for basic HTTP operations, allowing agents to perform CRUD-like actions (Create via POST, Read via GET, Update via PUT, Delete via DELETE). There are no obvious gaps for a server focused on making HTTP requests.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
    8
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.
    6
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    A server that translates Model Context Protocol (MCP) tool callings to traditional HTTP API requests, allowing existing HTTP APIs to be integrated into MCP territory through configurable mappings.
    1
    Apache 2.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fikri2992/mcp0'

If you have feedback or need assistance with the MCP directory API, please join our Discord server