Kobold MCP Server
The Kobold MCP Server enables integration with KoboldAI and provides both MCP and OpenAI-compatible APIs for various AI tasks:
Text Generation: Generate text with customizable parameters (temperature, max_length, stop_sequence)
Chat Completion: Engage in conversations with persistent memory
Image Generation: Create images from text (txt2img) or transform existing images (img2img)
Image Captioning: Generate descriptions for images using interrogator models
Audio Processing: Transcribe audio with Whisper and convert text to speech
Web Search: Perform searches via DuckDuckGo
Token Operations: Count tokens, convert token IDs to text, retrieve log probabilities
System Information: Access model details, version info, and performance metrics
Utility Functions: Abort ongoing generations, check context settings
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Kobold MCP Servergenerate a short fantasy story about a dragon and a knight"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Kobold MCP Server
A Model Context Protocol (MCP) server implementation for interfacing with KoboldAI. This server enables integration between KoboldAI's text generation capabilities and MCP-compatible applications.
Features
Text generation with KoboldAI
Chat completion with persistent memory
OpenAI-compatible API endpoints
Stable Diffusion integration
Built on the official MCP SDK
TypeScript implementation
Related MCP server: nanobanana-mcp
Installation
npm install kobold-mcp-serverPrerequisites
Node.js (v16 or higher)
npm or yarn package manager
Running KoboldAI instance
Usage
import { KoboldMCPServer } from 'kobold-mcp-server';
// Initialize the server
const server = new KoboldMCPServer();
// Start the server
server.start();Configuration
The server can be configured through environment variables or a configuration object:
const config = {
apiUrl: 'http://localhost:5001' // KoboldAI API endpoint
};
const server = new KoboldMCPServer(config);Supported APIs
Core KoboldAI API (text generation, model info)
Chat completion with conversation memory
Text completion (OpenAI-compatible)
Stable Diffusion integration (txt2img, img2img)
Audio transcription and text-to-speech
Web search capabilities
Development
Clone the repository:
git clone https://github.com/yourusername/kobold-mcp-server.git
cd kobold-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildDependencies
@modelcontextprotocol/sdk: ^1.0.1node-fetch: ^2.6.1zod: ^3.20.0zod-to-json-schema: ^3.23.5
Contributing
Contributions welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Support
For issues and feature requests, please use the GitHub issue tracker.
Available Tools
20 toolskobold_abortB
Abort the currently ongoing generation
Inputs: apiUrl.
kobold_chatC
Chat completion (OpenAI-compatible)
Inputs: messages (required), apiUrl, temperature, top_p, +2 more.
kobold_completeC
Text completion (OpenAI-compatible)
Inputs: prompt (required), apiUrl, max_tokens, temperature, +2 more.
kobold_detokenizeC
Convert token IDs to text
Inputs: tokens (required), apiUrl.
kobold_generateC
Generate text with KoboldAI
Inputs: prompt (required), apiUrl, max_length, max_context_length, +6 more.
kobold_img2imgC
Transform existing image using prompt
Inputs: prompt (required), init_images (required), apiUrl, negative_prompt, +7 more.
kobold_interrogateC
Generate caption for image
Inputs: image (required), apiUrl.
kobold_last_logprobsB
Get token logprobs from the last request
Inputs: apiUrl.
kobold_max_context_lengthB
Get current max context length setting
Inputs: apiUrl.
kobold_max_lengthB
Get current max length setting
Inputs: apiUrl.
kobold_model_infoB
Get current model information
Inputs: apiUrl.
kobold_perf_infoC
Get performance information
Inputs: apiUrl.
kobold_sd_modelsB
List available Stable Diffusion models
Inputs: apiUrl.
kobold_sd_samplersB
List available Stable Diffusion samplers
Inputs: apiUrl.
kobold_token_countC
Count tokens in text
Inputs: text (required), apiUrl.
kobold_transcribeC
Transcribe audio using Whisper
Inputs: audio (required), apiUrl, language.
kobold_ttsC
Generate text-to-speech audio
Inputs: text (required), apiUrl, voice, speed.
kobold_txt2imgC
Generate image from text prompt
Inputs: prompt (required), apiUrl, negative_prompt, width, +5 more.
kobold_versionB
Get KoboldAI version information
Inputs: apiUrl.
kobold_web_searchC
Search the web via DuckDuckGo
Inputs: query (required), apiUrl.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
20 tool updates
- First observed
kobold_abort - First observed
kobold_chat - First observed
kobold_complete - First observed
kobold_detokenize - First observed
kobold_generate - First observed
kobold_img2img - First observed
kobold_interrogate - First observed
kobold_last_logprobs - First observed
kobold_max_context_length - First observed
kobold_max_length - First observed
kobold_model_info - First observed
kobold_perf_info - First observed
kobold_sd_models - First observed
kobold_sd_samplers - First observed
kobold_token_count - First observed
kobold_transcribe - First observed
kobold_tts - First observed
kobold_txt2img - First observed
kobold_version - First observed
kobold_web_search
TDQS
Scored across 20 tools
Most tools have distinct purposes (e.g., text generation vs. image generation vs. utility functions), but there is some overlap between kobold_chat and kobold_complete (both for text generation) and kobold_token_count and kobold_detokenize (both token-related). Descriptions help clarify, but an agent might occasionally confuse similar tools.
All tool names follow a consistent snake_case pattern with a 'kobold_' prefix and descriptive suffixes (e.g., kobold_generate, kobold_model_info). This uniformity makes the set predictable and easy to navigate, with no deviations in style.
With 20 tools, the count is borderline high for a single server, as it covers diverse domains like text generation, image processing, audio, and utilities. While each tool serves a purpose, the scope feels broad, potentially overwhelming for agents focused on specific tasks.
The tool set covers core AI functionalities well, including text and image generation, audio processing, and model management. Minor gaps exist, such as no explicit tool for updating settings or managing generation parameters beyond aborting, but agents can work around these with the available tools.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.230MIT
- AlicenseAqualityDmaintenanceMCP server for AI image generation supporting text-to-image and image-to-image editing via any OpenAI-compatible service, with configurable models, aspect ratios, and sizes.2MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for OpenAI ChatGPT API. Enables chat completions, vision analysis, embeddings, and model listing through natural language.-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that exposes NovelAI image generation as tools for AI agents, supporting txt2img, img2img, inpaint, upscaling, Director tools, ControlNet annotation, tag suggestions, vibe encoding, and subscription queries via stdio or streamable-http transports.12MIT