Twig MCP Server

Connect your AI assistants to Twig's private knowledge base. Use with Cursor, Claude Desktop, OpenAI, or any MCP-compatible client.

Connecting...

๐ŸŽฏ MCP Server Primitives

The MCP server exposes tools, resources, and prompts that can be used by any MCP-compatible client

๐Ÿ› ๏ธ Tools3 available

check_mcp_server_healthPUBLIC

Check the health status of the MCP server

search_knowledgePROTECTED

Perform semantic search on your knowledge base for relevant documents and sources

ask_a_questionPROTECTED

Query your private Twig AI knowledge base for company-specific information

๐Ÿ“š Resources1 available

twig://{agentId}

Access to your Twig AI knowledge base agent

๐Ÿ’ก Prompts1 available

WhatIsTwig

Learn about Twig AI platform

Args: detail (basic, features, pricing, integration), name (optional)

๐Ÿ”Œ Integration Guide

Connect to the MCP server from various clients and platforms

๐Ÿ”Œ Integration Options

Connect to the MCP server from various clients and platforms:

ClientTypeSetup DifficultyBest For
๐Ÿ”ทcURL
Command LineEasyTesting & Debugging
๐ŸŸฃCursor IDE
IDE IntegrationEasyDevelopment
๐ŸŸ Claude Desktop
Desktop AppEasyChat Interface
๐ŸŸขOpenAI API
API IntegrationMediumCustom Apps (GPT)
๐Ÿ”ดClaude API
API IntegrationMediumCustom 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.

Get your API key from Twig Settings
Find your Agent ID in your Twig AI agent settings
๐Ÿ’ก 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_healthPUBLIC

Check the health status and system information of the MCP server.

Input Schema:
{} // No parameters required
Returns:
{
  "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_knowledgePROTECTED

Perform semantic search on your Twig AI knowledge base. Returns relevant documents and sources.

Input Schema:
{
  "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_questionPROTECTED

Query your private Twig AI knowledge base for AI-generated answers with citations.

Input Schema:
{
  "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

WhatIsTwig

Learn 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
}