Lightweight MCP client for TowardsAGI MCP servers
Project description
TMCP Client
Lightweight MCP client for TowardsAGI MCP servers
A minimal, efficient client for connecting to TowardsAGI MCP servers via HTTP API. Designed for use with Claude, Cursor, VS Code, and other MCP-compatible applications.
๐ Quick Start
Installation
# Install from PyPI
pip install tmcp-client
# Or use with uvx (no installation required)
uvx tmcp-client
Usage with MCP Applications
Add to your MCP configuration file (e.g., ~/.cursor/mcp.json):
{
"mcpServers": {
"my-database": {
"command": "uvx",
"args": ["tmcp-client"],
"env": {
"TOWARDSMCP_SERVER_URL": "https://your-server.com/",
"TOWARDSMCP_RESOURCE": "your-resource-name",
"TOWARDSMCP_API_KEY": "tmcp_your-api-key"
}
}
}
}
๐ Configuration
The client requires three environment variables:
| Variable | Description | Example |
|---|---|---|
TOWARDSMCP_SERVER_URL |
Your TMCP server URL | https://beta.towardsmcp.com/ |
TOWARDSMCP_RESOURCE |
Resource name to connect to | my-database |
TOWARDSMCP_API_KEY |
Your API key | tmcp_abc123... |
๐ง Installation Methods
Method 1: UVX (Recommended)
No installation required - automatically downloads and runs:
{
"command": "uvx",
"args": ["tmcp-client"],
"env": { ... }
}
Method 2: Global Installation
Install once, use everywhere:
pip install tmcp-client
{
"command": "tmcp-client",
"env": { ... }
}
Method 3: Python Module
Use with existing Python installation:
{
"command": "python",
"args": ["-m", "tmcp_client"],
"env": { ... }
}
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ HTTP/JSON-RPC โโโโโโโโโโโโโโโโโโโโ
โ MCP Client โ โโโโโโโโโโโโโโโโโโโบ โ TowardsAGI โ
โ (Claude/Cursor) โ โ MCP Server โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โฒ โ
โ stdio/JSON-RPC โ
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ tmcp-client โ โ Your Database โ
โ Bridge โ โ (PostgreSQL, โ
โโโโโโโโโโโโโโโโโโโ โ MongoDB, etc.) โ
โโโโโโโโโโโโโโโโโโโโ
๐ ๏ธ Development
Local Development
# Clone and install in development mode
git clone https://github.com/TowardsAGI-AI/tmcp-client.git
cd tmcp-client
pip install -e .
# Run tests
pytest
# Format code
black src/
isort src/
Building
# Build package
python -m build
# Install locally
pip install dist/tmcp_client-*.whl
๐ Examples
Basic Usage
import asyncio
from tmcp_client import TMCPBridge
async def example():
bridge = TMCPBridge()
# List available tools
tools = await bridge.list_tools()
print(f"Available tools: {[t['name'] for t in tools]}")
# Call a tool
result = await bridge.call_tool("query", {"sql": "SELECT 1"})
print(f"Result: {result}")
await bridge.close()
# Run with environment variables set
asyncio.run(example())
Multiple Resources
{
"mcpServers": {
"production-db": {
"command": "uvx",
"args": ["tmcp-client"],
"env": {
"TOWARDSMCP_SERVER_URL": "https://prod.towardsmcp.com/",
"TOWARDSMCP_RESOURCE": "prod-database",
"TOWARDSMCP_API_KEY": "tmcp_prod_key"
}
},
"analytics-db": {
"command": "uvx",
"args": ["tmcp-client"],
"env": {
"TOWARDSMCP_SERVER_URL": "https://analytics.towardsmcp.com/",
"TOWARDSMCP_RESOURCE": "analytics-warehouse",
"TOWARDSMCP_API_KEY": "tmcp_analytics_key"
}
}
}
}
๐ Troubleshooting
Common Issues
"Missing required environment variables"
- Ensure all three environment variables are set in your MCP config
"Authentication failed (401)"
- Check your
TOWARDSMCP_API_KEYis correct and not expired
"Resource not found (404)"
- Verify the
TOWARDSMCP_RESOURCEname matches your server configuration
"Connection timeout"
- Check your
TOWARDSMCP_SERVER_URLis accessible and correct
Debug Mode
Set TMCP_DEBUG=1 environment variable for verbose logging:
{
"env": {
"TOWARDSMCP_SERVER_URL": "...",
"TOWARDSMCP_RESOURCE": "...",
"TOWARDSMCP_API_KEY": "...",
"TMCP_DEBUG": "1"
}
}
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
๐ Support
- Issues: GitHub Issues
- Documentation: GitHub README
- Email: support@towardsagi.ai
Made with โค๏ธ by TowardsAGI.AI
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tmcp_client-1.0.1.tar.gz.
File metadata
- Download URL: tmcp_client-1.0.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f97bba7d90fe1c265fa8496d68c4bbfa59aa4e7fe7d1b8c3535ee53f571e2a40
|
|
| MD5 |
fcc52e476298e5f6450e1969b1156677
|
|
| BLAKE2b-256 |
ccbc6765f1410163414db6a9303974b95dd1ae18504a74b3704d7c568fd928c9
|
File details
Details for the file tmcp_client-1.0.1-py3-none-any.whl.
File metadata
- Download URL: tmcp_client-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fe71d7159137f8cdfdb4be12495399c6af116c954eb8368f9d11acc8ae09790
|
|
| MD5 |
030ee814813c162e0611d466453bf619
|
|
| BLAKE2b-256 |
6ed9333292f20a422048a719ce501f9ad8093e58c7678c3d8285241b8af2fcaa
|