mcp-server-llmling

by phil65
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Integrates with Codecov for tracking code coverage statistics and reporting.

  • Supports GitHub integration for repository management, tracking issues, pulls, stars and other GitHub project metrics.

  • Integrates with PyPI for package distribution and management information.

mcp-服务器-llmling

阅读文档!

LLMling 服务器手册

概述

mcp-server-llmling 是机器聊天协议 (MCP) 的服务器,它为 LLM 应用程序提供基于 YAML 的配置系统。

LLMLing后端为 LLM 应用程序提供了基于 YAML 的配置系统。它允许设置自定义 MCP 服务器,以提供 YAML 文件中定义的内容。

  • 静态声明:在 YAML 中定义 LLM 的环境 - 无需代码
  • MCP 协议:基于机器聊天协议 (MCP) 构建,用于标准化 LLM 交互
  • 组件类型
    • 资源:内容提供商(文件、文本、CLI 输出等)
    • 提示:带有参数的消息模板
    • 工具:LLM 可调用的 Python 函数

YAML 配置创建了一个完整的环境,为 LLM 提供:

  • 通过资源访问内容
  • 结构化提示,实现一致的互动
  • 扩展功能的工具

主要特点

1.资源管理

  • 加载和管理不同类型的资源:
    • 文本文件( PathResource
    • 原始文本内容( TextResource
    • CLI 命令输出( CLIResource
    • Python 源代码( SourceResource
    • Python 可调用结果( CallableResource
    • 图像( ImageResource
  • 支持资源监视/热重载
  • 资源处理管道
  • 基于URI的资源访问

2.工具系统

  • 将 Python 函数注册并执行为 LLM 工具
  • 支持基于 OpenAPI 的工具
  • 基于入口点的工具发现
  • 工具验证和参数检查
  • 结构化工具响应

3. 及时管理

  • 带有模板支持的静态提示
  • Python 函数的动态提示
  • 基于文件的提示
  • 提示参数验证
  • 提示论点的完成建议

4. 多种交通选择

  • 基于 Stdio 的通信(默认)
  • 适用于 Web 客户端的服务器发送事件 (SSE)
  • 支持自定义传输实现

用法

使用 Zed 编辑器

在您的settings.json中添加 LLMLing 作为上下文服务器:

{ "context_servers": { "llmling": { "command": { "env": {}, "label": "llmling", "path": "uvx", "args": [ "mcp-server-llmling", "start", "path/to/your/config.yml" ] }, "settings": {} } } }

使用 Claude Desktop

claude_desktop_config.json中配置 LLMLing:

{ "mcpServers": { "llmling": { "command": "uvx", "args": [ "mcp-server-llmling", "start", "path/to/your/config.yml" ], "env": {} } } }

手动启动服务器

直接从命令行启动服务器:

# Latest version uvx mcp-server-llmling@latest

1. 程序化使用

from llmling import RuntimeConfig from mcp_server_llmling import LLMLingServer async def main() -> None: async with RuntimeConfig.open(config) as runtime: server = LLMLingServer(runtime, enable_injection=True) await server.start() asyncio.run(main())

2. 使用自定义传输

from llmling import RuntimeConfig from mcp_server_llmling import LLMLingServer async def main() -> None: async with RuntimeConfig.open(config) as runtime: server = LLMLingServer( config, transport="sse", transport_options={ "host": "localhost", "port": 8000, "cors_origins": ["http://localhost:3000"] } ) await server.start() asyncio.run(main())

3.资源配置

resources: python_code: type: path path: "./src/**/*.py" watch: enabled: true patterns: - "*.py" - "!**/__pycache__/**" api_docs: type: text content: | API Documentation ================ ...

4.工具配置

tools: analyze_code: import_path: "mymodule.tools.analyze_code" description: "Analyze Python code structure" toolsets: api: type: openapi spec: "https://api.example.com/openapi.json" namespace: "api"

服务器配置

该服务器通过 YAML 文件进行配置,包含以下部分:

global_settings: timeout: 30 max_retries: 3 log_level: "INFO" requirements: [] pip_index_url: null extra_paths: [] resources: # Resource definitions... tools: # Tool definitions... toolsets: # Toolset definitions... prompts: # Prompt definitions...

MCP 协议

服务器实现了 MCP 协议,支持:

  1. 资源操作
    • 列出可用资源
    • 读取资源内容
    • 监视资源变化
  2. 工具操作
    • 列出可用的工具
    • 使用参数执行工具
    • 获取工具架构
  3. 快捷操作
    • 列出可用的提示
    • 获取格式化的提示
    • 获取提示参数的完成情况
  4. 通知
    • 资源变化
    • 工具/提示列表更新
    • 进度更新
    • 日志消息
-
security - not tested
A
license - permissive license
-
quality - not tested

机器聊天协议 (MCP) 的服务器,为 LLM 应用程序提供基于 YAML 的配置系统,允许用户定义资源、工具和提示,而无需编写代码。

  1. LLMling Server Manual
    1. Overview
    2. Key Features
    3. Usage
    4. Server Configuration
    5. MCP Protocol

Appeared in Searches

ID: 2mdjbbuzee