Skip to main content
Glama
mercy306

MCP API Integration Server

by mercy306

MCP API Integration Server

A Python MCP server that provides tools for interacting with various APIs.

Features

This MCP server includes the following tools:

  • get_weather - Get current weather information for any city

  • get_joke - Get a random programming joke

  • get_user_info - Get GitHub user profile information

  • search_repositories - Search GitHub repositories

  • make_http_request - Make custom HTTP requests to any API endpoint

Related MCP server: MCP Utility Kit

Installation

  1. Install dependencies:

pip install -r requirements.txt
  1. Run the server:

python server.py

Usage Examples

Weather Tool

# Get live weather data (real-time from Open-Meteo, free, no API key required)
result = await get_weather("London")

GitHub Tools

# Get user info
user = await get_user_info("octocat")

# Search repositories
repos = await search_repositories("python machine learning", limit=10)

Custom HTTP Requests

# GET request
response = await make_http_request("https://api.example.com/data")

# POST request
response = await make_http_request(
    "https://api.example.com/users",
    method="POST",
    json_body={"name": "John", "email": "john@example.com"}
)

Adding Your Own API Integrations

To add more API tools, simply create new functions decorated with @mcp.tool():

@mcp.tool()
async def my_custom_api(parameter: str) -> Dict[str, Any]:
    """
    Description of what this tool does.
    
    Args:
        parameter: Description of the parameter
    
    Returns:
        Description of the return value
    """
    async with httpx.AsyncClient() as client:
        response = await client.get(f"https://api.example.com/{parameter}")
        return response.json()

Configuration

You can configure API keys and other settings by:

  • Passing them as parameters to the tools

  • Setting environment variables

  • Creating a configuration file

Requirements

  • Python 3.10+

  • mcp-server package

  • httpx (async HTTP client)

Related MCP Connectors

Related MCP Servers