Twig MCP Server
Connect your AI assistants to Twig's private knowledge base. Use with Cursor, Claude Desktop, OpenAI, or any MCP-compatible client.
๐ฏ MCP Server Primitives
The MCP server exposes tools, resources, and prompts that can be used by any MCP-compatible client
๐ ๏ธ Tools3 available
Check the health status of the MCP server
Perform semantic search on your knowledge base for relevant documents and sources
Query your private Twig AI knowledge base for company-specific information
๐ Resources1 available
Access to your Twig AI knowledge base agent
๐ก Prompts1 available
Learn about Twig AI platform
๐ Integration Guide
Connect to the MCP server from various clients and platforms
๐ Integration Options
Connect to the MCP server from various clients and platforms:
| Client | Type | Setup Difficulty | Best For |
|---|---|---|---|
๐ทcURL | Command Line | Easy | Testing & Debugging |
๐ฃCursor IDE | IDE Integration | Easy | Development |
๐ Claude Desktop | Desktop App | Easy | Chat Interface |
๐ขOpenAI API | API Integration | Medium | Custom Apps (GPT) |
๐ดClaude API | API Integration | Medium | Custom Apps (Claude) |
๐ Usage Examples
Use cURL to test the MCP server directly from the command line:
List available tools
curl -X POST https://mcp.twig.so/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'Check MCP Server Health
curl -X POST https://mcp.twig.so/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {"name": "check_mcp_server_health", "arguments": {}},
"id": 1
}'Ask a Questionrequires auth
curl -X POST https://mcp.twig.so/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer YOUR_TWIG_API_KEY" \
-H "X-Twig-Agent-Id: YOUR_AGENT_ID" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "ask_a_question",
"arguments": {
"question": "What is a cluster?"
}
},
"id": 1
}'Search Knowledgerequires auth
curl -X POST https://mcp.twig.so/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer YOUR_TWIG_API_KEY" \
-H "X-Twig-Agent-Id: YOUR_AGENT_ID" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "search_knowledge",
"arguments": {
"query": "deployment best practices",
"limit": 10
}
},
"id": 1
}'๐ Ask a Question
Test ask a question tool by providing your Twig API credentials. The ask a question tool requires authentication via Authorization header (Bearer token) and X-Twig-Agent-Id header.
๐ก Security Note
Your API credentials are only used for this test request and are not stored. For production use, configure your MCP client (Cursor, Claude Desktop) to connect directly to the /mcp endpoint with your credentials.
๐ Search Knowledge
Test the search_knowledge tool to perform semantic search on your knowledge base. Returns relevant documents and sources based on your query.
Get your API key from Twig Settings
๐ก Note
Your API credentials are only used for this test request and are not stored. The search_knowledge tool returns relevant documents and sources from your knowledge base based on semantic similarity.
Check MCP Server Health
Check the health status and system information of the MCP server:
Available Tools
[]
๐ Developer Documentation
Technical documentation for integrating with the Twig MCP Server
Overview
The Twig MCP Server implements the Model Context Protocol specification, providing AI assistants with access to your Twig AI knowledge base through standardized tools, resources, and prompts.
๐ Authentication
Protected tools require authentication via HTTP headers:
Authorization: Bearer YOUR_TWIG_API_KEY X-Twig-Agent-Id: YOUR_AGENT_ID
Get your credentials from Twig Settings
๐ ๏ธ Available Tools
check_mcp_server_healthPUBLICCheck the health status and system information of the MCP server.
{} // No parameters requiredReturns:{
"status": "healthy",
"timestamp": "2024-01-15T10:30:00.000Z",
"uptime": 12345.67,
"memory": { "heapUsed": 123456 },
"version": "1.0.0",
"tools": ["check_mcp_server_health", "search_knowledge", "ask_a_question"],
"resources": ["twig"],
"prompts": ["WhatIsTwig"]
}search_knowledgePROTECTEDPerform semantic search on your Twig AI knowledge base. Returns relevant documents and sources.
{
"query": "string (required) - Search query",
"limit": "number (optional) - Max results (default: 20)",
"offset": "number (optional) - Pagination offset (default: 0)",
"memory": "string (optional) - Conversation context"
}Returns:{
"results": [
{
"title": "Document Title",
"snippet": "Relevant excerpt...",
"url": "https://...",
"score": 0.95
}
]
}ask_a_questionPROTECTEDQuery your private Twig AI knowledge base for AI-generated answers with citations.
{
"question": "string (required) - Your question",
"userEmail": "string (optional) - User email for tracking",
"sessionId": "string (optional) - Session ID for context"
}Returns:{
"answer": "AI-generated answer...",
"agentName": "Your Agent Name",
"citations": [
{
"title": "Source Title",
"url": "https://..."
}
]
}๐ Resources
twig://{agentId}Access to your Twig AI knowledge base agent. Replace {agentId} with your Agent ID.
๐ก Prompts
WhatIsTwigLearn about the Twig AI platform
Arguments:{
"detail": "basic | features | pricing | integration",
"name": "string (optional) - Your name for personalization"
}โ ๏ธ Error Handling
All errors follow the JSON-RPC 2.0 error format:
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Missing required credentials..."
},
"id": 1
}