关于 MCP Server -- Read Papers in the local Specified Directory
该 Go MCP 服务读取指定本地目录中的 PDF 论文,适合需要让 MCP 客户端查找和阅读本地论文的人。启动时通过参数指定论文目录。
主要功能
- 01指定本地 PDF 目录
- 02查找目录中的论文
- 03读取 PDF 内容
- 04通过 SSE 提供服务
适用场景
- 01列出本地论文文件
- 02按文件名定位论文
- 03让 MCP 客户端读取论文内容
MCP 相关
该服务向 MCP 客户端提供 `find_pdf` 和 `read_pdf` 工具,用于查找和阅读指定目录中的 PDF 论文。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
http://127.0.0.1:8080/sse一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http pdf http://127.0.0.1:8080/sseCursor.cursor/mcp.json
{"mcpServers":{"pdf":{"type":"http","url":"http://127.0.0.1:8080/sse"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"pdf":{"type":"http","url":"http://127.0.0.1:8080/sse"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"pdf":{"type":"http","url":"http://127.0.0.1:8080/sse"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"pdf":{"serverUrl":"http://127.0.0.1:8080/sse"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
工具
详细介绍
MCP 服务——读取本地指定目录中的论文
编译
go build -o pdf-mcp-server main.go
安装
将 pdf-mcp-server 二进制文件所在的路径添加到环境变量中。
以 macOS 为例:
export PATH=$PATH:/your/path/pdf-mcp-server
source ~/.zshrc
启动 MCP 服务
pdf-mcp-server -pdfdir=your_paper_directory
For example: pdf-mcp-server -pdfdir=/Users/sirix/lunwen
Cursor 设置
{
"mcpServers": {
"pdf-mcp-server": {
"url": "http://127.0.0.1:8080/sse"
}
}
}
设置 Cursor 规则
示例:
When handling PDF-related requests, call the find_pdf tool of the mcp server named "pdf-mcp-server" to list all papers in the /Users/sirix/lunwen directory, search for the paper with the corresponding file name in this directory, and use the read_pdf tool of the pdf-mcp-server to read it.
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。