MCP Deployment and Testing
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "deploy MCP server", "test MCP", "use ngrok", "MCP Inspector", "connect to ChatGPT", "create connector"…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
MCP Deployment and Testing for OpenAI Apps SDK
Overview
Deploying and testing MCP servers requires proper HTTPS setup, local development tools, and ChatGPT connector configuration. This skill covers the complete deployment workflow from local testing to production.
Local Development Setup
Running the Server
Python:
# Install dependencies
pip install mcp
# Run server
python server.py
# Server running on http://localhost:8000/mcp
TypeScript:
# Install dependencies
npm install @modelcontextprotocol/sdk express
# Run server
npx tsx server.ts
# Server running on http://localhost:8000/mcp
Exposing with ngrok
ChatGPT requires HTTPS. Use ngrok for local development:
# Install ngrok
brew install ngrok # macOS
# or download from ngrok.com
# Expose local server
ngrok http 8000
# Output:
# Forwarding https://abc123.ngrok.io -> http://localhost:8000
Save the HTTPS URL for ChatGPT connector setup.
MCP Inspector
Test MCP servers without ChatGPT integration:
Installation
npx @modelcontextprotocol/inspector@latest
Usage
# Test local server
npx @modelcontextprotocol/inspector http://localhost:8000/mcp
# Test ngrok URL
npx @modelcontextprotocol/inspector https://abc123.ngrok.io/mcp
Inspector Features
- List Tools - View all available tools and schemas
- Call Tools - Execute tools with test parameters
- View Resources - List and fetch MCP resources
- Test Widgets - Preview widget HTML rendering
- Debug Responses - Inspect structuredContent and _meta
ChatGPT Connector Setup
Enable Developer Mode
- Open ChatGPT settings
- Navigate to "Developer settings"
- Enable "Developer mode"
Create Connector
- Go to ChatGPT → Settings → Connectors
- Click "Add connector"
- Enter your MCP server URL (HTTPS required)
- Name your connector
- Save
Add to Conversation
- Start a new conversation
- Click the connector icon
- Select your connector
- Test with natural language prompts
Testing Workflow
1. Local Server Test
# Start server
python server.py
# Test with curl
curl http://localhost:8000/mcp \
-X POST \
-H "Content-Type: application/json" \
-d '{"method": "tools/list"}'
2. MCP Inspector Test
# Run inspector
npx @modelcontextprotocol/inspector http://localhost:8000/mcp
# In inspector:
# - Verify tools list correctly
# - Test each tool with sample inputs
# - Check widget rendering
3. ngrok Integration Test
# Expose server
ngrok http 8000
# Test HTTPS endpoint
curl https://abc123.ngrok.io/mcp \
-X POST \
-H "Content-Type: application/json" \
-d '{"method": "tools/list"}'
4. ChatGPT Integration Test
- Add connector with ngrok URL
- Test natural language tool invocation
- Verify widget rendering
- Check response accuracy
Debugging
Enable Debug Logging
Python:
import logging
logging.basicConfig(level=logging.DEBUG)
mcp = FastMCP("server", debug=True)
TypeScript:
const server = new Server(
{ name: "server", version: "1.0.0" },
{ capabilities: { tools: {} }, debug: true }
);
Common Issues
| Issue | Solution |
|---|---|
| Connection refused | Check server is running on correct port |
| SSL error | Use ngrok for HTTPS |
| Tool not found | Verify tool registration and naming |
| Widget not rendering | Check openai/outputTemplate URI |
| Auth failure | Verify tokens and security config |
Request Logging
Python:
@mcp.middleware
async def log_requests(request, call_next):
print(f"Request: {request.method} - {request.params}")
response = await call_next(request)
print(f"Response: {response}")
return response
Production Deployment
Hosting Options
| Platform | Notes |
|---|---|
| Railway | Easy Python/Node deployment |
| Render | Free tier available |
| Fly.io | Edge deployment |
| AWS Lambda | Serverless option |
| Google Cloud Run | Container-based |
Railway Deployment
# Install Railway CLI
npm install -g @railway/cli
# Login and init
railway login
railway init
# Deploy
railway up
Docker Deployment
Dockerfile (Python):
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "server.py"]
Build and run:
docker build -t mcp-server .
docker run -p 8000:8000 mcp-server
Environment Variables
Production configuration:
# .env.production
PORT=8000
HOST=0.0.0.0
DATABASE_URL=postgresql://...
API_KEY=your_production_key
LOG_LEVEL=INFO
Health Checks
Add a health check endpoint:
Python:
@mcp.tool()
def health_check() -> dict:
"""Server health check."""
return {
"structuredContent": {
"status": "healthy",
"version": "1.0.0",
"timestamp": datetime.now(
Установить MCP Deployment and Testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл MCP Deployment and Testing?
This skill should be used when the user asks to "deploy MCP server", "test MCP", "use ngrok", "MCP Inspector", "connect to ChatGPT", "create connector", "troubleshoot MCP", "debug server", or needs guidance on deploying and testing MCP servers for the OpenAI Apps SDK.
Как установить скилл MCP Deployment and Testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл MCP Deployment and Testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic