Skip to main content

TMCP Client

PyPI version Python 3.8+ License: MIT

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_KEY is correct and not expired

"Resource not found (404)"

  • Verify the TOWARDSMCP_RESOURCE name matches your server configuration

"Connection timeout"

  • Check your TOWARDSMCP_SERVER_URL is 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"
  }
}

Publishing Build Artifact

cd tmcp-client
twine upload dist/*
Enter your API token: "provoid API tocken from pypi project (tmcp/api_tocken.txt)"

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📞 Support


Made with ❤️ by TowardsAGI.AI

Metadata

Release files for tmcp-client 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tmcp-client 1.0.5
File Size Uploaded Provenance
tmcp_client-1.0.5.tar.gz 10.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tmcp-client 1.0.5
File Interpreter ABI Platform
tmcp_client-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / tmcp_client-1.0.5.tar.gz

Download URL tmcp_client-1.0.5.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cb9e3acd9b74939e8277dabd8daa14b06137c4bc4425ef618b6dbc7531126812
BLAKE2b-256 checksum
How to use checksums
198e14289124eeaf92c040e4d4c2029b5300e2c44646cf8be4cde7f327c1a131
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / tmcp_client-1.0.5-py3-none-any.whl

Download URL tmcp_client-1.0.5-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b8ddc5ed4bda1c3125dff3ae3ed1c2e6f5241b7c873bdbbb98fc9ec1977872a
BLAKE2b-256 checksum
How to use checksums
7c6338751e351fa43a95abbb1bf8eade3d92a8356cfa63f6bc1856322bcdb4d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for tmcp-client 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page