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

Features
This MCP server provides the following tools:
generate_code: Generate code based on a descriptiongenerate_code_to_file: Generate code and write it directly to a file at a specific line numbergenerate_documentation: Generate documentation for codeask_question: Ask a question to the LLM

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
- Clone the repository
- Install dependencies:
npm install
- Build the project:
npm run build
- 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
- MIT LICENSE
LLM Server
Project Details
- sammcj/mcp-llm
- mcp-llm
- MIT License
- Last Updated: 4/20/2025
Recomended MCP Servers
The MCP server for interacting with Blockchain, Swaps, Strategic Planning and more.
一个用来实现简单页面倒计时的轻量级工具
MCP server provides feishu related operations
JIRA integration server for Model Context Protocol (MCP) - enables LLMs to interact with JIRA tasks and workflows
A Model Context Protocol server that provides real-time hot trending topics from major Chinese social platforms and news...
MCP Server for Alpha Advantage API
Monitor browser logs directly from Cursor and other MCP compatible IDEs.
A Model Context Protocol server for interacting with Babashka, a native Clojure interpreter for scripting
A Model Context Protocol (MCP) server for reading Excel files with automatic chunking and pagination support. Built with...
A Binary Ninja plugin containing an MCP server that enables seamless integration with your favorite LLM/MCP client.





