发现网站架构并分析站点结构,通过抓取、解析和可视化来自任何URL的站点地图。无需手动探索即可揭示隐藏页面并提取有组织的层次结构。
包括用于Claude Desktop的现成提示模板,只需输入一个URL即可分析网站、检查站点地图健康状况、提取URL、查找缺失内容并创建可视化图表。
<a href="https://glama.ai/mcp/servers/@mugoosse/sitemap-mcp-server"> <img width="380" height="200" src="https://gips2.baidu.com/it/u=2041158060,1292704296&fm=3081&app=3081&f=PNG?w=760&h=400" /> </a>回答关于任何网站的问题,利用站点地图的力量。
<details><summary>Cursor:modelcontextprotocol.io有多少个页面?</summary> <br/> <img width="1541" alt="image" src="https://gips2.baidu.com/it/u=2003477342,1700865096&fm=3081&app=3081&f=PNG?w=3082&h=776" /> </details> <details><summary>Claude + 提示:在windsurf.com的图表中可视化站点地图</summary> <br/>点击工具按钮旁边的“附加”按钮:
然后选择visualize_sitemap:
现在我们输入windsurf.com:
我们得到了站点地图的可视化:
<img width="1470" alt="image" src="https://gips0.baidu.com/it/u=2273290525,2385470133&fm=3081&app=3081&f=PNG?w=2940&h=1832" /> </details>确保已安装uv。
在你的claude_desktop_config.json,Cursor设置等中添加以下条目:
{
"mcpServers": {
"sitemap": {
"command": "uvx",
"args": ["sitemap-mcp-server"],
"env": { "TRANSPORT": "stdio" }
}
}
}
如果Claude正在运行,请重启它。对于Cursor,只需刷新并在设置中启用MCP服务器。
要通过Smithery自动为Claude Desktop安装sitemap:
npx -y @smithery/cli install @mugoosse/sitemap --client claude
npx @modelcontextprotocol/inspector env TRANSPORT=stdio uvx sitemap-mcp-server
在http://127.0.0.1:6274打开MCP Inspector,选择stdio传输,并连接到MCP服务器。
# 启动服务器
uvx sitemap-mcp-server
# 在单独的终端启动MCP Inspector
npx @modelcontextprotocol/inspector connect http://127.0.0.1:8050
在http://127.0.0.1:6274打开MCP Inspector,选择sse传输,并连接到MCP服务器。
如果你想使用SSE传输,请按照以下步骤操作:
uvx sitemap-mcp-server
{
"mcpServers": {
"sitemap": {
"transport": "sse",
"url": "http://localhost:8050/sse"
}
}
}
有关从源代码构建和运行项目的说明,请参阅DEVELOPERS.md指南。
以下工具可通过MCP服务器获得:
get_sitemap_tree - 从网站URL获取并解析站点地图树
url(网站URL),include_pages(可选,布尔值)get_sitemap_pages - 获取网站站点地图中的所有页面,并带有过滤选项
url(网站URL),limit(可选),include_metadata(可选),route(可选),sitemap_url(可选),cursor(可选)get_sitemap_stats - 获取网站站点地图的统计信息
url(网站URL)parse_sitemap_content - 直接从其XML或文本内容解析站点地图
content(站点地图XML内容),include_pages(可选,布尔值)该服务器包括现成的提示,它们作为模板出现在Claude Desktop中。安装服务器后,你将在“模板”菜单中看到这些模板(点击消息输入旁边的+图标):
使用这些提示:
{
"name": "get_sitemap_tree",
"arguments": {
"url": "https://example.com",
"include_pages": true
}
}
{
"name": "get_sitemap_pages",
"arguments": {
"url": "https://example.com",
"limit": 100,
"include_metadata": true,
"route": "/blog/"
}
}
{
"name": "get_sitemap_pages",
"arguments": {
"url": "https://example.com",
"limit": 100,
"include_metadata": true,
"sitemap_url": "https://example.com/blog-sitemap.xml"
}
}
服务器实现了基于MCP游标的分页,以高效处理大型站点地图:
初始请求:
{
"name": "get_sitemap_pages",
"arguments": {
"url": "https://example.com",
"limit": 50
}
}
带分页的响应:
{
"base_url": "https://example.com",
"pages": [...], // 第一批页面
"limit": 50,
"nextCursor": "eyJwYWdlIjoxfQ=="
}
后续带游标的请求:
{
"name": "get_sitemap_pages",
"arguments": {
"url": "https://example.com",
"limit": 50,
"cursor": "eyJwYWdlIjoxfQ=="
}
}
当没有更多结果时,响应中将不包含nextCursor字段。
{
"name": "get_sitemap_stats",
"arguments": {
"url": "https://example.com"
}
}
响应包括总统计信息以及每个子站点地图的详细统计信息:
{
"total": {
"url": "https://example.com",
"page_count": 150,
"sitemap_count": 3,
"sitemap_types": ["WebsiteSitemap", "NewsSitemap"],
"priority_stats": {
"min": 0.1,
"max": 1.0,
"avg": 0.65
},
"last_modified_count": 120
},
"subsitemaps": [
{
"url": "https://example.com/sitemap.xml",
"type": "WebsiteSitemap",
"page_count": 100,
"priority_stats": {
"min": 0.3,
"max": 1.0,
"avg": 0.7
},
"last_modified_count": 80
},
{
"url": "https://example.com/blog/sitemap.xml",
"type": "WebsiteSitemap",
"page_count": 50,
"priority_stats": {
"min": 0.1,
"max": 0.9,
"avg": 0.5
},
"last_modified_count": 40
}
]
}
这允许MCP客户端了解哪些子站点地图可能需要进一步调查。然后可以使用get_sitemap_pages中的sitemap_url参数来筛选特定子站点地图中的页面。
{
"name": "parse_sitemap_content",
"arguments": {
"content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"><url><loc>https://example.com/</loc></url></urlset>",
"include_pages": true
}
}
本项目根据MIT许可证发布。详见LICENSE文件。