Sandbox
@sammcj/mcp-llm

MCP server for calling other LLMs from agents

MCP LLM is an MCP server that gives your agent access to other LLMs. It provides tools for generating code, writing code directly into a file, generating documentation, and asking questions.

78 stars13 forksJavaScriptUpdated 1y ago
Who it's for

Builders who use MCP-capable agents and want them to offload code and documentation tasks to another LLM.

What it delivers

You can have your agent call a separate LLM to draft code, fill files, and write docs without leaving your workflow.

What it does

Generate code

Takes a description and language, then returns generated code.

Write code to a file

Generates code and writes it to a specific file and line number, with optional line replacement.

Generate documentation

Produces documentation from source code in a chosen format such as JSDoc.

Ask a question

Sends a question and optional context to the LLM for an answer.

MCP setup options

Supports installation through Smithery and manual setup from source for MCP clients.

How to get it

  1. 1To install LLM Server for Claude Desktop automatically via Smithery
    npx -y @smithery/cli install @sammcj/mcp-llm --client claude
  2. 2Install dependencies
    npm install
  3. 3Build the project
    npm run build
  4. 4The repository includes an example script that demonstrates how to use the MCP server…
    node examples/use-mcp-server.js

README

MCP LLM

smithery badge

An MCP server that provides access to LLMs using the LlamaIndexTS library.

I put some LLMs in your MCP for your LLMs

mcp-llm MCP server

Features

This MCP server provides the following tools:

  • generate_code: Generate code based on a description
  • generate_code_to_file: Generate code and write it directly to a file at a specific line number
  • generate_documentation: Generate documentation for code
  • ask_question: Ask a question to the LLM

call a llm to generate code call a reasoning llm to write some documentation

Installation

Installing via Smithery

To install LLM Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @sammcj/mcp-llm --client claude

Manual Install From Source

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Update your MCP configuration

Using the Example Script

The repository includes an example script that demonstrates how to use the MCP server programmatically:

node examples/use-mcp-server.js

This script starts the MCP server and sends requests to it using curl commands.

Examples

Generate Code

{
  "description": "Create a function that calculates the factorial of a number",
  "language": "JavaScript"
}

Generate Code to File

{
  "description": "Create a function that calculates the factorial of a number",
  "language": "JavaScript",
  "filePath": "/path/to/factorial.js",
  "lineNumber": 10,
  "replaceLines": 0
}

The generate_code_to_file tool supports both relative and absolute file paths. If a relative path is provided, it will be resolved relative to the current working directory of the MCP server.

Generate Documentation

{
  "code": "function factorial(n) {\n  if (n <= 1) return 1;\n  return n * factorial(n - 1);\n}",
  "language": "JavaScript",
  "format": "JSDoc"
}

Ask Question

{
  "question": "What is the difference between var, let, and const in JavaScript?",
  "context": "I'm a beginner learning JavaScript and confused about variable declarations."
}

License

Files in the repo

Repository payload17 top-level entries
  • .github
  • examples
  • src
  • .gitignore
  • .nvmrc
  • CHANGELOG.md
  • Dockerfile
  • legit.png
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • sample-mcp-settings.json
  • screenshot1.png
  • screenshot2.png
  • smithery.yaml
  • tsconfig.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k