xinghao-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xinghao-mcp-serverCheck server health"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Xinghao MCP Server
A small, modular Model Context Protocol (MCP) server built with Python and FastMCP. It includes working examples of tools, prompts, and resources, plus a reusable async client for connecting to external APIs.
This repository is intended as a practical starting point for developing a custom MCP server.
Features
Python 3.11+ and the official MCP Python SDK
stdio,sse, andstreamable-httptransportsCentralized configuration through environment variables
Explicit registration for tools, prompts, and resources
Async
httpxclient base for external API integrationsDocker and Docker Compose support
Registry and tool tests with pytest
Related MCP server: FastMCP Training Course Server
Built-in MCP Capabilities
Type | Name or URI | Description |
Tool |
| Returns the service status and current UTC time |
Tool |
| Adds two numbers |
Tool |
| Subtracts the second number from the first |
Prompt |
| Creates a prompt for welcoming a new team member |
Resource |
| Returns basic server information as JSON |
Project Structure
.
├── app/
│ ├── base/ # Shared API client and result types
│ ├── prompts/ # MCP prompt implementations and registration
│ ├── resources/ # MCP resource implementations and registration
│ ├── tools/ # MCP tool implementations and registration
│ ├── config.py # Environment-based settings
│ └── server.py # FastMCP instance and component registration
├── tests/ # Registry and tool tests
├── .env.example # Environment variable template
├── docker-compose.yaml
├── Dockerfile
├── main.py # Application entry point
└── pyproject.toml # Package metadata and dependenciesGetting Started
1. Create a virtual environment
python -m venv .venvActivate it on macOS or Linux:
source .venv/bin/activateActivate it on Windows PowerShell:
.\.venv\Scripts\Activate.ps12. Install the project
For local development, install the package and test dependencies in editable mode:
python -m pip install -e ".[dev]"3. Configure the environment
Copy .env.example to .env, then adjust the values if needed:
MCP_TRANSPORT=stdio
MCP_HOST=127.0.0.1
MCP_PORT=8000
MCP_API_BASE_URL=
MCP_API_KEY=Variable | Default | Description |
|
| Transport: |
|
| Bind address for network transports |
|
| Bind port for network transports |
| Empty | Base URL used by the reusable external API client |
| Empty | Optional API key sent as the |
The external API settings are only needed by tools that use app.base.api_client.APIClient.
4. Run the server
The default stdio transport is suitable for local MCP clients:
python main.pyTo start a network transport, update MCP_TRANSPORT in .env. For example:
MCP_TRANSPORT=streamable-http
MCP_HOST=127.0.0.1
MCP_PORT=8000Then run:
python main.pyThe Streamable HTTP endpoint is available at http://127.0.0.1:8000/mcp.
Connect an MCP Client
For a client that launches local MCP servers over stdio, use a configuration like this and replace the paths with absolute paths on your machine:
{
"mcpServers": {
"xinghao-mcp-server": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/xinghao-mcp-server/main.py"]
}
}
}On Windows, the command typically points to .venv\\Scripts\\python.exe.
Docker
The Compose configuration starts the server with Streamable HTTP on port 8000:
docker compose up --buildAfter startup, connect to:
http://localhost:8000/mcpStop the service with:
docker compose downExtending the Server
Add a tool
Define a typed function in
app/tools/.Import it in
app/tools/__init__.py.Register it inside
register_tools()withmcp.tool().
FastMCP uses the function signature and docstring to generate the tool schema and description.
Add a prompt
Define the prompt function in app/prompts/, then register it in register_prompts() with mcp.prompt().
Add a resource
Define the resource function in app/resources/, then register it in register_resources() with a URI such as mcp.resource("example://item").
Call an external API
Use or extend app.base.api_client.APIClient for async JSON GET and POST requests. It reads the configured base URL and can attach an API key through the X-API-Key header.
Testing
Run the test suite:
python -m pytestThe current tests verify the built-in tool behavior and confirm that all tools, prompts, and resources are registered.
License
No license file is currently included. Add a license before distributing or reusing this project outside its intended scope.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/yr3710/xinghao-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server