SM

sammcj/mcp-llm

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

83 stars 14 forks Качество 58 Тренд 0MIT

sammcj/mcp-llm - кандидат на сервер MCP, импортированный из https://github.com/sammcj/mcp-llm.

Обзор

sammcj/mcp-llm - кандидат на сервер MCP, импортированный из https://github.com/sammcj/mcp-llm.

Обзор (машинный перевод)

Сервер MCP, обеспечивающий доступ к LLM с использованием библиотеки LlamaIndexTS.

Особенности

Этот MCP-сервер предоставляет следующие инструменты:

  • [[Т0]]: Создание кода на основе описания
  • [[Т1]]: Создайте код и запишите его непосредственно в файл по определенному номеру строки
  • [[Т2]]: Создание документации для кода
  • [[Т3]]: Задать вопрос в LLM

##Установка

###Установка через Smithery

Для автоматической установки LLM Server для Claude Desktop через Smithery:

Ручная инсталляция из источника

  1. Клонировать хранилище
  2. Установить зависимости:

3.Создать проект:

4 Обновление конфигурации MCP

###Использование сценария

Репозиторий включает в себя пример сценария, который демонстрирует, как программно использовать сервер MCP:

Этот скрипт запускает сервер MCP и отправляет на него запросы с помощью команд curl.

Примеры

###Создание кода

Создайте код для файла

Инструмент generate_code_to_file поддерживает как относительные, так и абсолютные пути файлов. Если предоставляется относительный путь, он будет разрешен относительно текущего рабочего каталога сервера MCP.

###Создать документацию

###Задать вопрос

Лицензия

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

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 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

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

Открыть полный README на GitHub

Установка

npx -y @smithery/cli install @sammcj/mcp-llm --client claude
Новичок в MCP? Начните с руководства на mcpskill.org →