Skip to main content
Glama

gremlin_mcp

从YouTube教程 https://www.youtube.com/watch?v=io02ZM0ADqM MCP初学者完整课程中学习 注意:我让Copilot或其他LLM清理了现有的工具代码,并添加了它认为有用的其他工具。有几个工具应谨慎使用,因为它们可以修改文件和目录。我还没有正确测试工具的使用。需要用这个MCP构建一些有用的东西,并设置适当的防护措施。

一个MCP(模型上下文协议)服务器,为代理提供终端和文件管理能力:运行shell/Python命令,搜索和读取文件,以及创建/编辑/删除文件和文件夹。

基于FastMCP构建。

工具

服务器暴露了21个工具,分组如下:

Shell / Python执行

工具

用途

run_command

运行shell命令(Windows上为cmd,Unix上为sh)

python_code

使用当前解释器执行Python代码片段

python_file

执行Python脚本文件

搜索与读取

工具

用途

glob_files

列出匹配glob模式的绝对路径

grep

在单个文件中匹配行(带行号)

search_text

在目录下递归搜索

read_file

以UTF-8格式读取整个文件

read_file_lines

读取基于1的行范围

get_env_var

读取环境变量

文件与文件夹

工具

用途

write_file / append_file

写入或追加UTF-8文本

replace_in_file

查找并替换,返回更改的计数

copy_file / move_file

复制或移动(自动创建父目录)

delete_file / delete_folder

删除文件或文件夹

create_folder

创建文件夹(包括父目录)

list_dir / get_cwd / file_info / tree

目录内省

Related MCP server: emcp

要求

  • Python >= 3.13

  • fastmcp >= 3.4.7

安装

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

启动服务器

服务器通过stdio通信,这是FastMCP的默认传输方式。从仓库根目录使用以下任一命令启动:

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

测试

1. 离线冒烟测试(无需MCP客户端)

python test.py

这会导入服务器,调用每个工具(创建并清理临时文件夹),并打印[PASS]/[FAIL]摘要以及总数。

2. 交互式Web检查器

fastmcp dev inspector src/gremlin_mcp/main.py

在浏览器中打开MCP Inspector,以便浏览工具、阅读其描述/示例,并交互式调用它们。

注意:fastmcp dev是一个子命令组,因此必须显式传递inspector子命令(单独使用fastmcp dev src/...将失败)。

3. 快速CLI检查

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

4. 从MCP客户端连接

将编辑器/客户端的MCP配置指向服务器,通过stdio连接,例如:

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

示例工具调用

如同代理发出的调用:

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)

项目布局

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

安全说明

run_commandpython_codepython_file执行任意代码。仅将此服务器暴露给您信任的代理/客户端,并考虑在沙箱或受限工作目录中运行它。

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.

  • An MCP server for deep research or task groups

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jvcaesar/gremlin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server