Skip to main content

This project is a Python-based **MCP Server** that dynamically fetches plugin definitions from **SuperiorAPIs** and auto-generates MCP tool functions based on OpenAPI schemas.

Project description

SuperiorAPIs MCP Server Tool

📖 Description

This project is a Python-based MCP Server that dynamically fetches plugin definitions from SuperiorAPIs and auto-generates MCP tool functions based on OpenAPI schemas.

The server will:

  • Fetch plugin metadata
  • Parse the schema
  • Generate tool functions dynamically
  • Run the MCP server

🚀 Features

  • Dynamic plugin loading from SuperiorAPIs
  • Auto-generation of pydantic models and async functions
  • Asynchronous API execution using aiohttp
  • Runtime MCP tool registration
  • Supports environment-based configuration
  • Ready for UVX platform deployment

📂 Project Structure

.
├── main.py                 # MCP server core logic
├── requirements.txt        # Python dependency list
├── setup.py                # Packaging setup
├── Dockerfile              # (Optional) Docker container build file
└── README.md               # Project documentation

⚙️ Installation

Clone the project and install the dependencies:

git clone https://your-repo-url.git
cd your-repo
pip install -r requirements.txt

🌍 Environment Variables

Before running, set the following environment variables:

Linux/macOS

export TOKEN=your_token_here
export APPLICATION_ID=your_application_id_here

Windows CMD

set TOKEN=your_token_here
set APPLICATION_ID=your_application_id_here

🖥️ Usage

Run the MCP server:

python main.py

The server will:

  1. Fetch plugin data from SuperiorAPIs
  2. Dynamically generate MCP tool functions
  3. Register the tools
  4. Start the MCP server

🔗 API Endpoint

Plugin definitions are fetched from:

https://superiorapis-creator.cteam.com.tw/manager/module/plugins/list_v2

Authorization is required via the token header.

🧠 Example Generated Tool Function

@mcp.tool()
async def post_example_tool(param1: Optional[str] = None, param2: Optional[int] = None) -> str:
    """
    Tool description | API summary.

    # Args:
        param1 (string, optional): Description of param1.
        param2 (integer, optional): Description of param2.

    # Returns:
        200 (object): API response.
    """

📜 Requirements

aiohttp>=3.8.6
pydantic>=2.5.3
mcp-sdk>=0.1.0

❗ Error Handling

If the API call fails or returns status: 0, the program will exit with:

❌ Error: API returned no data or status is 0. Please check if the API is working properly.

📦 Packaging (Optional)

Build the package:

python setup.py sdist bdist_wheel

Install the package:

pip install dist/mcp-superiorapis-1.0.0-py3-none-any.whl

Run using Docker (if needed):

docker build -t superiorapis-mcp .
docker run -e TOKEN=your_token -e APPLICATION_ID=your_app_id superiorapis-mcp

📄 License

MIT License (or your custom license)

👨‍💻 Author

Your Name / Your Company
Contact: your_email@example.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_superiorapis-1.1.8.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_superiorapis-1.1.8-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_superiorapis-1.1.8.tar.gz.

File metadata

  • Download URL: mcp_superiorapis-1.1.8.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for mcp_superiorapis-1.1.8.tar.gz
Algorithm Hash digest
SHA256 1884df30f2ae7c54fa800364a3592c55e6c79e8834e363cfa5f33af8963e26bb
MD5 6a63903dc9c280637f5f9ddd36d5f2fc
BLAKE2b-256 7a87a294b49970e12e0b4892a52a1c284f1bbc5d8d746ef168e2ed3083902707

See more details on using hashes here.

File details

Details for the file mcp_superiorapis-1.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_superiorapis-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 50ab42dd167fcefcd5d977467857aa6c1fcb67677465f2021c0b0102a2143e26
MD5 ba438aa66fe3951e09cc47199d251315
BLAKE2b-256 a8f9d4891a60c95e86b959c8915ae7ebcd137db68e0c560e1df89a96c700e113

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page