本地文件MCP服务器

一个简单的MCP服务器,用于提供本地文件服务,支持开发环境快速搭建和日志文件查询。

  • by schms27
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 schms27/local-file-mcp-server

使用说明

local-file-mcp-server

A simple mcp server to serve local files

Development getting started

This project uses uv, a better and faster python package manager. Install it according to this documentation.

Prepare dev environment

Create venv and install all dependencies defined in pyproject.toml:

uv sync --all-groups

Run server locally

uv run main.py

Add MCP server to vscode

  1. Press CTR + SHIFT + P, select 'MCP: Add server'
  2. Select 'Command'
  3. As Command, type in: 'uv --directory "/ABSOLUTE/PATH/TO/REPOS/FOLDER/" run main.py'
  4. Enter Server ID, i.e. 'my-local-file-mcp-server'
  5. The mcp server should show under 'MCP Servers - Installed' area:

Example 1: Query local logfiles

Open ChatWindow with the tool 'get_logfiles' enabled as context and ask something along the lines: 'What happened between the communication of service a and service b according to the logs?'

The model should be able to pick up the test-logfiles in the ./logs subfolder and answer the question in this context.