Messages MCP Server
A Model Context Protocol (MCP) server built with Python that provides access to messages from an external API endpoint. This server demonstrates how to integrate with external APIs using Authorization headers for authentication.
Features
- Messages Resource: Fetch all messages from the configured API endpoint
- Authorization Header Authentication: Uses Bearer token authentication
- Error Handling: Comprehensive error handling for API requests
- Response Metadata: Includes response time and status information
Installation
Prerequisites
- Python 3.9 or higher
pip
package manager
Using pip
Development Installation
Development
Running in Development Mode
Use the MCP Inspector for testing and debugging:
Testing
Code Quality
Usage
Claude Desktop Integration
To use this server with Claude Desktop, add the following to your Claude Desktop configuration:
Available Resources
messages://{message_id}
- Fetch messages by ID from the API endpoint
API Request Format
When you access the messages://{message_id}
resource, the server makes a GET request like this:
Architecture
The server is built using the FastMCP framework, which provides:
- Automatic Protocol Handling: JSON-RPC 2.0 message routing
- Type Safety: Full type hints and validation
- Async Support: Built on asyncio for high performance
- Easy Testing: Built-in development tools
Configuration
The server can be configured through environment variables:
MCP_SERVER_NAME
- Server name (default: "Messages Server")MCP_LOG_LEVEL
- Logging level (default: "INFO")API_URL
- API endpoint URL (default: "https://api-url.com/messages")AUTHORIZATION_TOKEN
- Authorization header token (default: "Bearer your-token-here")
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests and linting
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Resources
This server cannot be installed
A Model Context Protocol server that provides access to messages from an external API endpoint using Bearer token authentication for integration with Claude Desktop.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server implementation for interacting with Salesforce through its REST API.Last updated -410TypeScript
- -securityFlicense-qualityA Model Context Protocol server that allows Claude to make API requests on your behalf, providing tools for testing various APIs including HTTP requests and OpenAI integrations without sharing your API keys in the chat.Last updated -Python
UseGrant MCP Serverofficial
AsecurityAlicenseAqualityA Model Context Protocol server that provides tools for managing providers, clients, tenants, and access tokens through the UseGrant platform.Last updated -26116JavaScriptMIT LicenseMCP SSE Ory Serverofficial
-security-license-qualityImplements a Model Context Protocol server using Server-Sent Events for real-time communication with OAuth 2.1 integration via Ory Network, enabling secure AI model communication with authentication and client management.Last updated -Apache 2.0