MCP连接器
一种为LLM提供访问其他LLM的MCP服务器
可用工具 (4 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
generate_code 3 个参数 需填 1 项
Generate code based on a description
必填参数:description
generate_code_to_file 6 个参数 需填 3 项
Generate code and write it directly to a file at a specific line number
必填参数:description、filePath、lineNumber
generate_documentation 3 个参数 需填 1 项
Generate documentation for code
必填参数:code
ask_question 2 个参数 需填 1 项
Ask a question to the LLM
必填参数:question
服务介绍
MCP LLM
这是一个使用LlamaIndexTS库提供LLM访问的MCP服务器。

功能
此MCP服务器提供了以下工具:
generate_code: 根据描述生成代码generate_code_to_file: 生成代码并直接写入指定行号的文件中generate_documentation: 为代码生成文档ask_question: 向LLM提问


安装
通过Smithery安装
要通过Smithery自动为Claude Desktop安装LLM Server:
npx -y @smithery/cli install @sammcj/mcp-llm --client claude
从源码手动安装
- 克隆仓库
- 安装依赖项:
npm install
- 构建项目:
npm run build
- 更新您的MCP配置
使用示例脚本
该仓库包含一个示例脚本,演示了如何以编程方式使用MCP服务器:
node examples/use-mcp-server.js
此脚本启动MCP服务器并通过curl命令向其发送请求。
示例
生成代码
{
"description": "Create a function that calculates the factorial of a number",
"language": "JavaScript"
}
生成代码到文件
{
"description": "Create a function that calculates the factorial of a number",
"language": "JavaScript",
"filePath": "/path/to/factorial.js",
"lineNumber": 10,
"replaceLines": 0
}
generate_code_to_file 工具支持相对和绝对文件路径。如果提供了相对路径,它将相对于MCP服务器的当前工作目录解析。
生成文档
{
"code": "function factorial(n) {\n if (n <= 1) return 1;\n return n * factorial(n - 1);\n}",
"language": "JavaScript",
"format": "JSDoc"
}
提问
{
"question": "What is the difference between var, let, and const in JavaScript?",
"context": "I'm a beginner learning JavaScript and confused about variable declarations."
}