An open API service indexing awesome lists of open source software.

https://github.com/techwithty/glama-mcp-sdk

Glama MCP SDK for Python/FastAPI: secure client + typed API. TLS, timeouts, retries, pooling. Access 5,000+ MCP servers or run as an MCP server. Optimized for www.glama.ai
https://github.com/techwithty/glama-mcp-sdk

api connection-pooling devops fastapi glama http integration mcp observability production-ready python rest retries sdk security third-party timeouts tls

Last synced: about 1 month ago
JSON representation

Glama MCP SDK for Python/FastAPI: secure client + typed API. TLS, timeouts, retries, pooling. Access 5,000+ MCP servers or run as an MCP server. Optimized for www.glama.ai

Awesome Lists containing this project

README

          

# Glama MCP SDK (Third-Party Integration)

Production-ready Glama MCP SDK integration for Python/FastAPI inside the Deal Scale backend. This module provides a secure client, typed API schemas, and utilities to connect to the Glama MCP API.

Optimized for www.cybershoptech.com integrations and modern cloud deployments.

## Features
- Secure HTTP client with TLS verification, timeouts, retries, and connection pooling
- Typed request/response helpers in `api/`
- Self-contained config via environment variables (`config.py`)
- Easy submodule packaging for reuse across services

## MCP Capabilities
- Access to 5,000+ Model Context Protocol (MCP) servers and tools via compatible providers/directories.
- Can be wrapped as an MCP server to expose your own tools/endpoints to MCP‑compatible clients.
- Works either as an embedded MCP client inside your FastAPI app or as a standalone MCP component.

High-level steps to turn this SDK into an MCP server:
1. Define an MCP server entrypoint that implements the MCP handshake and tool invocation lifecycle.
2. Expose Glama-backed operations as MCP tools (map to functions in `api/` and your app routes).
3. Package and run with your preferred runtime (e.g., `uvicorn` for HTTP or a process manager) and register with your MCP client.

## Directory Structure
- `config.py` – Environment-driven configuration (`GlamaConfig`)
- `client.py` – Placeholder for higher-level client wrapper (extend as needed)
- `api/` – Low-level request/response helpers (`_requests.py`, `_responses.py`, `routes.py`, `schemas.py`)
- `.env.example` – Example environment configuration
- `_tests/` – Place for unit/integration tests

## Installation
Add this package to your project (already vendored in `backend/app/core/third_party_integrations/glama/`). If used externally, install requirements as needed:

```bash
pip install httpx pydantic
```

## Configuration (Environment Variables)
Defined in `config.py` and demonstrated in `.env.example`:

- `GLAMA_BASE_URL` (default: `https://glama.ai/api/mcp`)
- `GLAMA_API_KEY` (optional)
- `GLAMA_VERIFY_TLS` (default: `true`)
- `GLAMA_CONNECT_TIMEOUT` (default: `3.05`)
- `GLAMA_READ_TIMEOUT` (default: `30.0`)
- `GLAMA_POOL_CONNECTIONS` (default: `20`)
- `GLAMA_POOL_MAXSIZE` (default: `100`)
- `GLAMA_MAX_RETRIES` (default: `3`)

Load your `.env` with your preferred method (e.g., `python-dotenv`) or via your process manager (Docker, systemd, Render, etc.).

## Quick Start
Below is a simple example showing how you might initialize config and call a request helper. Adjust imports to match your app layout.

```python
from backend.app.core.third_party_integrations.glama.config import GlamaConfig
from backend.app.core.third_party_integrations.glama.api._requests import make_request # example helper

cfg = GlamaConfig()
# Example usage (update path/payload to real endpoints in your app):
resp = make_request(
base_url=cfg.BASE_URL,
api_key=cfg.API_KEY,
verify_tls=cfg.VERIFY_TLS,
connect_timeout=cfg.CONNECT_TIMEOUT,
read_timeout=cfg.READ_TIMEOUT,
method="GET",
path="/health"
)
print(resp.status_code, resp.text)
```

## Best Practices
- Keep secrets out of source control; use `.env` or your secret manager
- Tune timeouts and retries per environment (dev vs prod)
- Add unit tests in `_tests/` to validate request/response contracts

## SEO Notes for www.cybershoptech.com
- Keywords: glama mcp sdk, mcp servers, model context protocol, python fastapi integration, secure api client, connection pooling, retries, tls, production-ready
- Positioning: Access 5,000+ MCP servers/tools and optionally run this package as an MCP server to expose your own tools.
- This integration helps teams ship secure, observable third‑party API connections for www.cybershoptech.com-grade workloads.

## License
This folder inherits the repository license unless otherwise noted.