Skip to main content
The Model Context Protocol (MCP) is a standardized framework that enables AI models to interact with external data sources and tools. It allows for real-time access to your Keywords AI logs, traces, prompts, and customer data directly from your coding environment.

Getting started

Keywords AI provides an MCP server that gives your AI tools direct access to your observability data. The server supports both HTTP streamable (for hosted deployments) and stdio (for local use).

Installation


Authentication

ModeAPI Key LocationBest For
Public HTTPAuthorization headerIndividual users, quick setup
Local StdioKEYWORDS_API_KEY env varPersonal development, offline use
Private HTTPVercel environment variableTeams, shared access
Get your Keywords AI API key from platform.keywordsai.co.

Enterprise configuration

For enterprise users with a custom API endpoint (e.g., endpoint.keywordsai.co), you can override the default API base URL.
Add the keywords-api-base-url header:
{
  "mcpServers": {
    "keywords-ai": {
      "url": "https://mcp.keywordsai.co/api/mcp",
      "headers": {
        "Authorization": "Bearer your_keywords_ai_api_key",
        "keywords-api-base-url": "https://endpoint.keywordsai.co/api"
      }
    }
  }
}
Supported endpoints:
EndpointURL
Default (Cloud)https://api.keywordsai.co/api
Enterprisehttps://endpoint.keywordsai.co/api
Local developmenthttp://localhost:8000/api

Available tools

Once connected, your AI tools have access to the following Keywords AI features.

Logs

ToolDescription
list_logsList and filter LLM request logs with powerful query capabilities
get_log_detailRetrieve complete details of a single log by unique ID
Example queries:
  • “Show me the most expensive requests from the last hour”
  • “Find all failed requests for customer user_123”
  • “List logs where latency > 5 seconds”

Traces

ToolDescription
list_tracesList and filter traces with sorting and pagination
get_trace_treeRetrieve complete hierarchical span tree of a trace
Example queries:
  • “Show me traces with errors in production”
  • “Get the span tree for trace xyz123”
  • “Find traces that cost more than $0.10”

Customers

ToolDescription
list_customersList customers with pagination and sorting
get_customer_detailGet customer details including budget usage
Example queries:
  • “Who are my top 10 customers by cost?”
  • “Show customer budget usage for user_abc”
  • “List customers sorted by number of requests”

Prompts

ToolDescription
list_promptsList all prompts in your organization
get_prompt_detailGet detailed prompt information
list_prompt_versionsList all versions of a prompt
get_prompt_version_detailGet specific version details
Example queries:
  • “Show me all my prompts”
  • “Get the latest version of my customer-support prompt”
  • “What are the different versions of prompt xyz?”

Troubleshooting

  1. Verify your config file path is correct
  2. Check JSON syntax (use a JSON validator)
  3. Restart your AI tool completely (not just reload)
  4. For stdio mode: ensure npm run build completed successfully
  1. Verify your API key is correct
  2. For HTTP mode: ensure header is Authorization: Bearer YOUR_KEY (not just the key)
  3. For stdio mode: check the KEYWORDS_API_KEY env var is set correctly
  1. Check your internet connection
  2. For enterprise: verify KEYWORDS_API_BASE_URL is correct
  3. For private HTTP: ensure Vercel deployment is active

Source code

The Keywords AI MCP server is open source:

GitHub Repository

View source code, report issues, and contribute