Speelka Agent

Universal LLM agent based on the Model Context Protocol (MCP)

Universal LLM agent based on the Model Context Protocol (MCP), with the ability to utilize tools from other MCP servers.

Use Cases

Improving Accuracy

Splitting large, complex instructions into specialized, focused tasks to improve response accuracy.

Cost Reduction

Using different models to handle different parts of a task, reducing overall operational costs.

Response Customization

Extending, narrowing down, or modifying the structure of third-party MCP server responses.

Implementation Switching

Easily switch between real and LLM-based implementations of a given tool.

Capability Constraints

Restrict the list of available tools in an MCP server to constrain system capabilities.

Workflow Orchestration

Orchestrate multi-step workflows across multiple MCP tools within a single agent session.

Budget Enforcement

Enforce per-request token and cost budgets to ensure predictable usage.

Automatic Retry

Automatic retry and exponential backoff handling for transient LLM or MCP server errors.

Provider Switching

Seamlessly switch between different LLM services (e.g., OpenAI, Anthropic) with unified configuration.

Architecture

%%{
  init: {
    'theme': 'dark',
    'themeVariables': {
      'primaryColor': '#8a5cf6',
      'primaryTextColor': '#f9fafb',
      'primaryBorderColor': '#8a5cf6',
      'lineColor': '#8a5cf6',
      'secondaryColor': '#6d28d9',
      'tertiaryColor': '#131525',
      'edgeLabelBackground': '#131525'
    }
  }
}%%
flowchart TB
    User["Any MCP Client"] --> |"1. Request"| Agent["Speelka Agent"]
    Agent --> |"2. Format prompt"| LLM["LLM Service"]
    LLM --> |"3. Tool calls"| Agent
    Agent --> |"4. Execute tools"| Tools["External MCP Tools"]
    Tools --> |"5. Return results"| Agent
    Agent --> |"6. Process repeat"| LLM
    Agent --> |"7. Final answer"| User

    classDef default fill:#131525,stroke:#8a5cf6,stroke-width:2px,color:#f9fafb;
                    
  1. User request is received by the Agent
  2. Agent processes the request and initializes a Chat session
  3. LLM Service is called with the formatted prompt and available tools
  4. LLM responds with text and/or tool calls
  5. For each tool call, MCP Connector executes the tool on an appropriate server
  6. Tool results are added to the Chat history
  7. The process repeats until LLM issues an "answer" command
  8. Final response is returned to the user through Agent

Usage Guide

Follow this simple step-by-step guide to set up your agent

1

Create Your API Key

For security and better management, it's recommended to create a dedicated API key for your LLM provider:

Important Security Note

Create a new API key from your LLM provider and set it as an environment variable:

export SPL_LLM_API_KEY=your_llm_api_key_here

You can get an API key from OpenAI's website or your preferred LLM provider.

2

Create Your Configuration File

First, decide what type of agent you want to create based on your needs:

Create a file named config.yaml with the following content, depending on your chosen agent:

3

Set up your MCP Client

To interact with your Speelka Agent, you'll need an MCP-compatible client.

Claude Desktop

Check out the Claude Desktop setup guide for installation instructions.

Configure Claude Desktop to use your Speelka Agent by editing the claude_desktop_config.json file:

{
  "mcpServers": {
    "speelka": {
      "command": "./speelka-agent",
      "args": ["--config", "config.yaml"],
      "env": {
        "SPL_LLM_API_KEY": "your_llm_api_key_here"
      }
    }
  }
}

Documentation

Complete documentation is available on GitHub