Llamacpp
БесплатноНе проверенAn MCP server for running local LLMs using llama-cpp-python, with built-in tools for generating drug-like molecule SMILES.
Описание
An MCP server for running local LLMs using llama-cpp-python, with built-in tools for generating drug-like molecule SMILES.
README
An MCP (Model Context Protocol) wrapper for running local LLMs using llama-cpp-python. This project provides a framework for integrating local language models as MCP tools with built-in support for specialized models like SmileyLlama.
SmileyLlama Integration
Generate SMILES strings (chemical notation) for drug-like molecules with fine-grained constraints:
- Lipinski's Rule of Five validation
- Hydrogen bond donor/acceptor limits
- Molecular weight and LogP constraints
- Warhead SMARTS pattern matching
- Macrocycle detection and filtering
- And more...
Installation
Prerequisites
- Python ≥ 3.13
uv(recommended) or pip
Setup
Clone the repository and install dependencies:
git clone <repository-url>
cd llamacpp-mcp
uv sync
Backend Configuration
The llama-cpp-python library requires compilation with hardware acceleration support. Choose the appropriate backend for your system:
CUDA (NVIDIA GPUs):
CMAKE_ARGS="-DGGML_CUDA=on" uv pip install llama-cpp-python --force-reinstall --no-cache-dir
ROCm (AMD GPUs):
CMAKE_ARGS="-DGGML_HIPBLAS=on" uv pip install llama-cpp-python --force-reinstall --no-cache-dir
Metal (Apple Silicon):
CMAKE_ARGS="-DGGML_METAL=on" uv pip install llama-cpp-python --force-reinstall --no-cache-dir
CPU-only (no GPU acceleration):
uv sync
Usage
Run the agent example
Setup your example/fastagent.secrets.yaml:
anthropic:
api_key: your-api-key-here
Then run the agent interface in the terminal:
cd example/
uv run --extra agent agent.py
Running the MCP Server
Start the MCP server with a GGUF model:
uv run llamacpp-mcp -i /path/to/model.gguf
Additional parameters can be passed as command-line arguments:
uv run llamacpp-mcp --input model.gguf -n_gpu_layers -1 -n_threads 8
Common parameters:
-n_gpu_layers: Number of model layers to offload to GPU (-1 for all)-n_threads: Number of CPU threads to use-n_ctx: Context window size-verbose: Verbosity level
Available Tools
generate_smiles
Generate SMILES strings for drug-like molecules with optional constraints.
Parameters:
max_hbond_donors: Maximum hydrogen bond donorsmax_hbond_acceptors: Maximum hydrogen bond acceptorsmax_molecular_weight: Maximum molecular weightmax_clogp: Maximum calculated LogPlipinski_rule_of_five: Enforce Lipinski's Rule of Fiverule_of_three: Enforce Rule-of-Three for fragment-like molecules- And additional constraint options...
Dependencies
Core:
fastmcp>=2.13.1- MCP server frameworkllama-cpp-python>=0.3.16- LLM inference engine
Optional:
fast-agent-mcp>=0.2.25- For agent-based integrations
Development
Project Setup
The project uses uv for dependency management. After installing uv, run:
uv sync
This installs all dependencies in a local virtual environment.
Adding New Models
To add a new model type:
- Create a subdirectory under
src/llamacpp_mcp/models/ - Implement
models.pywith Pydantic constraint definitions - Implement
tools.pywith tool registration function - Import and register tools in the main
__init__.py
Configuration
Model parameters can be configured via:
- Command-line arguments - Pass directly to
llamacpp-mcp - Environment variables - Set before running the server
- Agent Tool Configuration - See
example/fastagent.config.yamlfor reference
License
MIT License
Author
Lukas Kim
Установка Llamacpp
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/lukasmki/llamacpp-mcpFAQ
Llamacpp MCP бесплатный?
Да, Llamacpp MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Llamacpp?
Нет, Llamacpp работает без API-ключей и переменных окружения.
Llamacpp — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Llamacpp в Claude Desktop, Claude Code или Cursor?
Открой Llamacpp на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Llamacpp with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
