Twynity MCP Project Template
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Twynity MCP Project Templatecheck my external connection status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Replicate MCP Server
A production-ready Model Context Protocol (MCP) server for accessing Replicate's AI models. This server enables AI applications to run Replicate models through the MCP protocol, allowing for secure and controlled access with encrypted credential storage.
Features
Run Replicate AI models with input parameters
List public models available on Replicate
Get detailed information about specific models
Securely store API credentials in MongoDB with encryption
Integration with Twynity's auth and connection management system
MCP Apps UI support for visualization
Related MCP server: Model Context Protocol Template
Setup
Prerequisites
Python 3.11 or higher
MongoDB instance (for connection storage)
Replicate API token from replicate.com
Installation
Install the dependencies:
uv sync --lockedCopy
.env.exampleto.envand configure the environment variables:
cp .env.example .envEdit .env with your configuration:
MONGODB_URI- MongoDB connection string for storing encrypted connectionsENCRYPTION_KEY- Fernet encryption key for securing credentials (generate withuv run python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())")ACCOUNT_SERVICE_URL- Twynity account service URLACCOUNT_SERVICE_JWKS_ENDPOINT- JWKS endpoint for verifying JWTsACCOUNT_SERVICE_JWKS_CACHE_TTL- Cache TTL for JWKSLICENSE_KEY- License key for usage trackingLICENSE_SERVER_BASE_URL- License server base URLLICENSE_SERVER_JWKS_ENDPOINT- JWKS endpoint for license verificationLICENSE_SERVER_ACTIVATION_ENDPOINT- License activation endpointUSAGE_REPORT_ENDPOINT- Usage reporting endpoint
Run the Server
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000Tools
run_model - Run a Replicate model with input parameters
list_models - List all public models available on Replicate
get_model_info - Get detailed information about a specific model
check_replicate_connection - Verify connection to Replicate API
Configuration
The server expects a .env file with the following variables:
# MongoDB for secure connection storage
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=twynity_mcp
# Encryption key (required)
ENCRYPTION_KEY=your_fernet_encryption_key_here
# Twynity account service details
ACCOUNT_SERVICE_URL=https://accounts.twynity.com
ACCOUNT_SERVICE_JWKS_ENDPOINT=/oauth2/keys
ACCOUNT_SERVICE_JWKS_CACHE_TTL=300
# License service details
LICENSE_KEY=
LICENSE_SERVER_BASE_URL=https://license.twynity.com
LICENSE_SERVER_JWKS_ENDPOINT=/oauth2/keys
LICENSE_SERVER_ACTIVATION_ENDPOINT=/activate
# Usage reporting endpoint
USAGE_REPORT_ENDPOINT=https://usage.twynity.com/api/v1/report
# Public URL for the server
PUBLIC_URL=http://localhost:8000
# Environment (development, staging, production)
ENVIRONMENT=development
# Allowed origins for CORS
ALLOWED_ORIGINS=*Authentication and Security
This server uses Twynity's authentication system which requires:
A valid bearer JWT token
A
Persona-Idheader identifying the user's project/persona context
Credentials are stored securely encrypted in MongoDB, with each connection scoped to a specific user and persona pair.
Development
Running Tests
uv run pytest -qCode Quality
uv run ruff check app testsDeployment
Docker
docker build -t replicate-mcp .
docker run -p 8000:8000 replicate-mcpLicense
MIT License - see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
FastMCP commerce server starter: product catalog, search, and checkout. Deploy to Vercel in 5 min.
Build multi-tenant apps over MCP. Schemas, CRUD, deploys — access control enforced server-side.
Related MCP Servers
- AlicenseCqualityDmaintenancemcp-starter is a secure, starter framework for building MCP servers with JWT-based authentication, multi-tenant enforcement, and schema validation. Built with Node.js and Docker152 npm1MIT
- AlicenseNot gradedqualityDmaintenanceA production-ready MCP server template that connects LLMs and AI agents to external data, tools, and services with built-in OAuth 2.1 authentication, Redis-backed session management, and a modular tools engine.1MIT
- AlicenseAqualityCmaintenanceA starter template for building single-client MCP servers that expose existing REST APIs, deployable via stdio in customer-controlled environments. It provides a structured foundation with validated config, error handling, write authorization, and a mock upstream for local development.2MIT
- FlicenseNot gradedqualityBmaintenanceProvides a production-shaped FastMCP server with embedded MCP App UIs, including authentication, licensing, usage reporting, manifest and health routes, container setup, and deployment workflows.1-