jun3355986/mcp-server
3.2
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a simple MCP (Model Context Protocol) server that provides functionality to read file contents.
Tools
get_my_info
Reads the content of a specified file and returns it.
Get My Info MCP Server
这是一个简单的MCP(Model Context Protocol)服务器,提供读取文件内容的功能。
功能
get_my_info
: 读取指定文件的内容并返回
在Cursor中配置MCP
方法1:使用Cursor设置界面
- 打开Cursor
- 进入设置(Settings)
- 搜索"MCP"或"Model Context Protocol"
- 在MCP配置中添加以下配置:
{
"mcpServers": {
"get-my-info": {
"command": "uv",
"args": ["run", "python", "get_my_info.py"],
"cwd": "/Users/jun_mini_m4pro/workspace/mcp/server/my_info",
"env": {}
}
}
}
方法2:直接编辑配置文件
- 在Cursor中打开命令面板(Cmd+Shift+P)
- 搜索"Preferences: Open Settings (JSON)"
- 在settings.json中添加MCP配置:
{
"mcp.servers": {
"get-my-info": {
"command": "uv",
"args": ["run", "python", "get_my_info.py"],
"cwd": "/Users/jun_mini_m4pro/workspace/mcp/server/my_info"
}
}
}
使用方法
配置完成后,你可以在Cursor的聊天界面中使用以下工具:
- get_my_info: 读取文件内容
- 参数:
file_path
(字符串) - 要读取的文件路径 - 返回:文件内容或None(如果文件不存在或无法读取)
- 参数:
示例
在Cursor聊天中,你可以这样使用:
请使用get_my_info工具读取README.md文件的内容
或者:
使用get_my_info工具检查config.json文件是否存在
本地测试
你可以使用以下命令测试MCP服务器:
# 测试工具功能
uv run python get_my_info.py --test
# 运行MCP服务器(用于调试)
uv run python get_my_info.py
依赖
- Python 3.13+
- uv (包管理器)
- mcp[cli]>=1.10.1
- httpx>=0.28.1
安装依赖
uv sync
故障排除
-
MCP服务器无法启动:
- 确保已安装所有依赖:
uv sync
- 检查Python路径是否正确
- 确保文件路径存在
- 确保已安装所有依赖:
-
Cursor无法找到MCP服务器:
- 检查配置文件中的路径是否正确
- 重启Cursor
- 检查MCP配置是否已保存
-
权限问题:
- 确保uv和Python有执行权限
- 检查工作目录权限