此仓库包含一个针对 Dev.to 的 Model Context Protocol(MCP)服务器实现,允许AI助手访问并与其内容进行交互。
<a href="https://glama.ai/mcp/servers/@Arindam200/devto-mcp"> <img width="380" height="200" src="https://gips2.baidu.com/it/u=1345137407,189887274&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Dev.to Server MCP 服务器" /> </a>
Model Context Protocol(MCP)是一种标准,用于使AI助手能够与外部服务、工具和数据源进行接口。此服务器实现了MCP规范,以提供对 Dev.to 内容的访问。要了解更多关于MCP的信息,请查看这个视频
git clone https://github.com/Arindam200/devto-mcp.git
cd devto-mcp
连接到MCP服务器
复制以下JSON,并使用适当的{{PATH}}值:
{
"mcpServers": {
"devto": {
"command": "{{PATH_TO_UV}}", // 运行 `which uv` 并在此处放置输出
"args": [
"--directory",
"{{PATH_TO_SRC}}",// 进入仓库,运行 `pwd` 并在此处输入输出
"run",
"server.py"
],
"env": {
"DEV_TO_API_KEY":"您的 Dev.to API 密钥" // 从 https://dev.to/settings/extensions 获取
}
}
}
}
您可以从您的Dev.to 设置页面获取 Dev.to API 密钥。
对于Claude,将其保存为 claude_desktop_config.json 在您的 Claude Desktop 配置目录中:
~/Library/Application Support/Claude/claude_desktop_config.json
对于Cursor,将其保存为 mcp.json 在您的 Cursor 配置目录中:
~/.cursor/mcp.json
重启 Claude Desktop / Cursor
打开 Claude Desktop,您现在应该能看到 Devto 作为一个可用集成。
或者重启 Cursor。
该服务器提供了以下工具:
get_latest_articles() - 获取 Dev.to 上的最新文章get_top_articles() - 获取 Dev.to 上最受欢迎的文章get_articles_by_tag(tag) - 根据标签获取文章get_article_by_id(id) - 根据ID获取特定文章search_articles(query, page=1) - 根据标题/描述中的关键词搜索文章get_article_details(article_id) - 获取特定文章的全部内容和元数据get_articles_by_username(username) - 获取特定作者撰写的文章create_article(title, body_markdown, tags, published) - 创建并发布一篇新文章update_article(article_id, title, body_markdown, tags, published) - 更新一篇现有文章这里有一些示例,您可以向连接到此服务器的AI助手询问:
服务器需要 Dev.to API 密钥来进行某些操作,特别是创建和更新文章时。API 密钥应设置为环境变量 DEV_TO_API_KEY。
欢迎贡献!请随时提交拉取请求。
本项目根据MIT许可证授权 - 查看 LICENSE 文件了解详情。