A comprehensive Python client for connecting to MCP (Model Context Protocol) OpenAPI Proxy servers.
This project provides tools and utilities to connect to and interact with MCP OpenAPI Proxy servers that expose MCP tools as REST API endpoints. It includes authenticated clients, testing utilities, and configuration templates.
- π Secure Authentication: Bearer token authentication with multiple configuration options
- β° Time Operations: Current time retrieval and timezone conversions
- π§ Knowledge Graph: Create and manage entities, relations, and observations
- π Filesystem Operations: Secure file reading, writing, and directory management
- π§ͺ Comprehensive Testing: Full test suite with authentication
- π Documentation: Complete setup guides and API documentation
pip install requests
# Option A: Environment variable (recommended)
export MCP_API_TOKEN="your-api-token"
# Option B: Token file
echo "your-api-token" > mcp_token.txt
# Option C: Interactive setup
python3 examples/setup_auth.py
python3 src/mcp_authenticated_client.py time_now
mcps/
βββ src/ # Main source code
β βββ mcp_authenticated_client.py # Full-featured authenticated client
β βββ mcp_proxy_client.py # Basic client (no auth)
βββ tests/ # Test files
β βββ test_mcp_tools.py # Comprehensive tool tests
β βββ test_mcp_connection.py # Basic connection tests
β βββ auth_helper.py # Authentication discovery
βββ config/ # Configuration templates
β βββ auth_config_template.json # Authentication template
β βββ claude_desktop_config.json # Claude Desktop config
β βββ cline_mcp_settings.json # VS Code/Cline config
β βββ mcp_client_config.json # Generic MCP client config
βββ server_config/ # Server configuration management
β βββ mcp-config.json # Local copy of server config
β βββ server_notes.md # Server setup documentation
β βββ sync_config.py # Configuration sync tool
β βββ README.md # Server management guide
βββ examples/ # Example scripts
β βββ setup_auth.py # Interactive auth setup
βββ docs/ # Documentation
β βββ README.md # Detailed usage guide
β βββ SETUP_COMPLETE.md # Complete setup documentation
β βββ SUCCESS_SUMMARY.md # Success summary with examples
βββ .gitignore # Git ignore file (excludes tokens)
This client supports multiple authentication methods:
-
Environment Variable (Recommended)
export MCP_API_TOKEN="your-token"
-
Token File
echo "your-token" > mcp_token.txt
-
Configuration File Edit
config/auth_config_template.json
with your token -
Direct Parameter
client = MCPAuthenticatedClient(token="your-token")
# Time operations
python3 src/mcp_authenticated_client.py time_now "Europe/London"
python3 src/mcp_authenticated_client.py time_convert "15:00" "UTC" "Asia/Tokyo"
# Filesystem operations
python3 src/mcp_authenticated_client.py fs_list_dirs
python3 src/mcp_authenticated_client.py fs_list "/allowed/directory"
# Memory operations
python3 src/mcp_authenticated_client.py memory_graph
python3 src/mcp_authenticated_client.py memory_search "technology"
from src.mcp_authenticated_client import MCPAuthenticatedClient
client = MCPAuthenticatedClient()
# Time operations
time_nyc = client.time_get_current_time("America/New_York")
conversion = client.time_convert_time("UTC", "14:30", "Asia/Tokyo")
# Memory operations
graph = client.memory_read_graph()
client.memory_create_entities([{
"name": "Python",
"entityType": "Programming Language",
"observations": ["Object-oriented", "Popular for AI"]
}])
# Filesystem operations
directories = client.fs_list_allowed_directories()
content = client.fs_read_text_file("/path/to/file.txt")
Your setup currently includes Memory, Time, and Filesystem servers. You can add many more:
# List available servers
python3 scripts/add_mcp_server.py list
# Add a new server (example: web scraping)
python3 scripts/add_mcp_server.py fetch
# Add GitHub integration
python3 scripts/add_mcp_server.py github
- π Web & APIs:
fetch
,brave-search
,puppeteer
- π» Development:
github
,gitlab
,postman
- ποΈ Databases:
sqlite
,postgresql
- βοΈ Cloud:
google-drive
,aws
,azure
- π¬ Communication:
slack
,discord
- π° Finance:
alphavantage
,stripe
See docs/available_mcp_servers.md
for complete list and setup instructions.
python3 server_config/sync_config.py sync # Sync from remote
python3 server_config/sync_config.py list # List current servers
python3 server_config/sync_config.py status # Check service status
- Host:
ajlennon@ollama
(192.168.0.7:8000) - Active Servers: Memory, Time, Filesystem (3 servers)
- Configuration:
/home/ajlennon/mcp-service/mcp-config.json
- Service: MCP Proxy (
mcpo
) with REST API exposure
Run the comprehensive test suite:
python3 tests/test_mcp_tools.py
Test specific components:
python3 tests/test_mcp_connection.py # Basic connectivity
python3 tests/auth_helper.py # Authentication discovery
Template configuration files are provided in the config/
directory for various MCP clients:
- Claude Desktop:
config/claude_desktop_config.json
- VS Code/Cline:
config/cline_mcp_settings.json
- Generic:
config/mcp_client_config.json
- Token Protection: All sensitive tokens are excluded from git via
.gitignore
- Multiple Auth Methods: Flexible authentication options for different environments
- Secure Defaults: Environment variables recommended for production use
Comprehensive documentation is available in the docs/
directory:
docs/README.md
- Detailed usage guidedocs/SETUP_COMPLETE.md
- Complete setup instructionsdocs/SUCCESS_SUMMARY.md
- Success summary with examples
- Python 3.6+
requests
library- MCP OpenAPI Proxy server with Bearer token authentication
This project is provided as-is for connecting to MCP OpenAPI Proxy servers.
This is a client implementation for a specific MCP OpenAPI Proxy server. Contributions welcome for additional features and improvements.