mcp-server-llmling is a server implementation for the Machine Chat Protocol (MCP) that provides a YAML-based configuration system for LLM applications. It allows you to define resources, tools, and prompts that LLMs can interact with, all without writing code - just configuration in YAML.
You can install and run the mcp-server-llmling using several methods:
The easiest way to run the latest version:
# Run the latest version
uvx mcp-server-llmling@latest
# Run with a specific configuration file
uvx mcp-server-llmling start path/to/your/config.yml
You can install the package with pip:
pip install mcp-server-llmling
Then run it:
mcp-server-llmling start path/to/your/config.yml
The server is configured through a YAML file with several main sections:
global_settings:
timeout: 30
max_retries: 3
log_level: "INFO"
requirements: []
pip_index_url: null
extra_paths: []
resources:
# Resource definitions go here
tools:
# Tool definitions go here
toolsets:
# Toolset definitions go here
prompts:
# Prompt definitions go here
Resources provide content that LLMs can access:
resources:
python_code:
type: path
path: "./src/**/*.py"
watch:
enabled: true
patterns:
- "*.py"
- "!**/__pycache__/**"
api_docs:
type: text
content: |
API Documentation
================
...
Tools are Python functions that LLMs can execute:
tools:
analyze_code:
import_path: "mymodule.tools.analyze_code"
description: "Analyze Python code structure"
toolsets:
api:
type: openapi
spec: "https://api.example.com/openapi.json"
Add LLMLing as a context server in your settings.json
:
{
"context_servers": {
"llmling": {
"command": {
"env": {},
"label": "llmling",
"path": "uvx",
"args": [
"mcp-server-llmling",
"start",
"path/to/your/config.yml"
]
},
"settings": {}
}
}
}
Configure LLMLing in your claude_desktop_config.json
:
{
"mcpServers": {
"llmling": {
"command": "uvx",
"args": [
"mcp-server-llmling",
"start",
"path/to/your/config.yml"
],
"env": {}
}
}
}
from llmling import RuntimeConfig
from mcp_server_llmling import LLMLingServer
import asyncio
async def main() -> None:
async with RuntimeConfig.open(config) as runtime:
server = LLMLingServer(runtime, enable_injection=True)
await server.start()
asyncio.run(main())
from llmling import RuntimeConfig
from mcp_server_llmling import LLMLingServer
import asyncio
async def main() -> None:
async with RuntimeConfig.open(config) as runtime:
server = LLMLingServer(
config,
transport="sse",
transport_options={
"host": "localhost",
"port": 3001,
"cors_origins": ["http://localhost:3000"]
}
)
await server.start()
asyncio.run(main())
The server supports various resource types:
PathResource
)TextResource
)CLIResource
)SourceResource
)CallableResource
)ImageResource
)Resources can be configured to automatically update when their sources change (hot-reload).
Tools extend LLM capabilities by providing access to Python functions:
Prompts provide templated interactions:
The server supports multiple communication methods:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "llmling" '{"command":"uvx","args":["mcp-server-llmling","start","path/to/your/config.yml"],"env":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"llmling": {
"command": "uvx",
"args": [
"mcp-server-llmling",
"start",
"path/to/your/config.yml"
],
"env": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"llmling": {
"command": "uvx",
"args": [
"mcp-server-llmling",
"start",
"path/to/your/config.yml"
],
"env": []
}
}
}
3. Restart Claude Desktop for the changes to take effect