gremlin-mcp

gremlin-mcp

An MCP server that gives an agent terminal and file-management capabilities, including running shell/Python commands, searching and reading files, and creating/editing/deleting files and folders.

Category
访问服务器

README

gremlin_mcp

Learning from this Youtube TUT https://www.youtube.com/watch?v=io02ZM0ADqM MCP Full Course for Beginners Note: I asked Copilot or some other LLM to clean up the existing code for tools and added any others it thought would be useful. There are several tools that should be used with caution as they can modify the files and directories. I haven't tested tool usage properly. Need to build something useful with this mcp and with proper guardrails.

An MCP (Model Context Protocol) server that gives an agent terminal and file-management capabilities: run shell/Python commands, search and read files, and create/edit/delete files and folders.

Built on FastMCP.

Tools

The server exposes 21 tools, grouped as follows:

Shell / Python execution

Tool Purpose
run_command Run a shell command (cmd on Windows, sh on Unix)
python_code Execute a Python snippet with the running interpreter
python_file Execute a Python script file

Search & read

Tool Purpose
glob_files List absolute paths matching a glob pattern
grep Matching lines (with line numbers) in a single file
search_text Recursive search under a directory
read_file Read a whole file as UTF-8
read_file_lines Read a 1-based range of lines
get_env_var Read an environment variable

Files & folders

Tool Purpose
write_file / append_file Write or append UTF-8 text
replace_in_file Find & replace, returns the count changed
copy_file / move_file Copy or move (auto-creates parent dirs)
delete_file / delete_folder Delete a file or folder
create_folder Create a folder (including parents)
list_dir / get_cwd / file_info / tree Directory introspection

Requirements

  • Python >= 3.13
  • fastmcp >= 3.4.7

Installation

uv sync            # recommended
# or
python -m pip install -e .

Starting the server

The server communicates over stdio, which is FastMCP's default transport. Start it from the repo root with any of:

uv run python -m gremlin_mcp.main
python test.py serve
python start_gremlin_mcp_server.py

Testing

1. Offline smoke test (no MCP client needed)

python test.py

This imports the server, calls every tool (creating and cleaning up a temporary folder), and prints a [PASS]/[FAIL] summary plus a total.

2. Interactive web inspector

fastmcp dev inspector src/gremlin_mcp/main.py

Opens the MCP Inspector in your browser so you can browse the tools, read their descriptions/examples, and call them interactively.

Note: fastmcp dev is a subcommand group, so the inspector subcommand must be passed explicitly (fastmcp dev src/... alone will fail).

3. Quick CLI checks

fastmcp inspect src/gremlin_mcp/main.py    # server info + tool summary
fastmcp list   src/gremlin_mcp/main.py     # just the tool names

4. Connecting from an MCP client

Point your editor/client's MCP config at the server via stdio, for example:

{
  "mcpServers": {
    "gremlin-mcp": {
      "command": "uv",
      "args": ["run", "python", "-m", "gremlin_mcp.main"]
    }
  }
}

Example tool calls

As an agent would issue them:

list_dir(path="src")
search_text(pattern="TODO", directory="src")
read_file(file="pyproject.toml")
write_file(file="hello.py", content="print('hi')")
python_code(code="print(6 * 7)")          # -> exit=0 / 42
replace_in_file(path="config.py", old="DEBUG = True", new="DEBUG = False")
tree(path=".", depth=2)

Project layout

src/gremlin_mcp/
├── __init__.py
├── tools.py   # all tool definitions (21 tools)
└── main.py    # FastMCP server entry point
test.py        # offline smoke test / optional server launcher
start_gremlin_mcp_server.py   # minimal "run the server" launcher

Security note

run_command, python_code and python_file execute arbitrary code. Only expose this server to agents/clients you trust, and consider running it inside a sandbox or restricted working directory.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选