一个简单的前端市场,用于托管与Poke兼容的MCP服务器。
cd nextjs-marketplace
npm install
npm run dev
打开 http://localhost:3000 查看市场。
每个MCP服务器都在Render上独立部署:
https://hackernews-mcp.onrender.com/mcp | GitHubhttps://weather-mcp-mqrh.onrender.com/mcp | GitHubhttps://github-mcp-lgfb.onrender.com/mcp | GitHubhttps://reddit-mcp-7ms2.onrender.com/mcp | GitHubhttps://spotify-mcp-092h.onrender.com/mcp | GitHubhttps://news-mcp-xd6i.onrender.com/mcp | GitHub每个MCP服务器都可以在Render.com上单独部署:
前提条件:
步骤:
访问 render.com 并使用GitHub账号注册/登录
点击 "新建 +" → "Web服务"
连接包含MCP服务器的GitHub仓库
配置服务:
github-mcp(或您喜欢的名称)Python 3免费pip install -r requirements.txtpython src/server.py否(建议用于免费层级)设置环境变量:
PORT:8000GITHUB_TOKEN:您的GitHub个人访问令牌创建GitHub个人访问令牌:
repo,read:user,read:orgGITHUB_TOKEN值前提条件:
步骤:
在Render上创建一个新的Web服务
配置服务:
weather-mcpPython 3免费pip install -r requirements.txtpython src/server.py设置环境变量:
PORT:8000步骤:
在Render上创建一个新的Web服务
配置服务:
hackernews-mcpPython 3免费pip install -r requirements.txtpython src/server.py设置环境变量:
PORT:8000前提条件:
步骤:
在Render上创建一个新的Web服务
配置服务:
reddit-mcpPython 3免费pip install -r requirements.txtpython src/server.py设置环境变量:
PORT:8000REDDIT_CLIENT_ID:您的Reddit应用客户端IDREDDIT_CLIENT_SECRET:您的Reddit应用客户端密钥获取Reddit API凭证:
pokeMCPMarket脚本(用于个人用途)通过Poke市场集成访问Reddit数据的MCP服务器https://github.com/yourusername/mcp-reddithttp://localhost:8080client_id和client_secret前提条件:
步骤:
在Render上创建一个新的Web服务
配置服务:
spotify-mcpPython 3免费pip install -r requirements.txtpython src/server.py设置环境变量:
PORT:8000SPOTIFY_CLIENT_ID:您的Spotify应用客户端IDSPOTIFY_CLIENT_SECRET:您的Spotify应用客户端密钥获取Spotify API凭证:
您的MCP服务器(或您喜欢的名称)用于Spotify集成的MCP服务器https://spotify-mcp.onrender.com(使用您的已部署URL)https://spotify-mcp.onrender.com(使用您的已部署URL)Client ID和Client Secret注意:使用您的已部署Render URL(而不是localhost),因为Spotify出于安全原因需要HTTPS。
重要:如果您添加了API密钥(GitHub令牌、天气API密钥、Reddit凭证),请注意不要公开分享您的已部署前端,因为它将包含您的MCP服务器URL。
在app/page.tsx中更新MCP服务器URL为您的已部署Render URL:
const mcpServers = [
{
id: 'hackernews',
name: 'Hacker News',
description: '浏览和搜索Hacker News故事',
icon: '/hackerNews.png',
capabilities: ['get_top_stories', 'get_story', 'get_new_stories'],
url: 'https://your-hackernews-mcp.onrender.com/mcp', // 更新此URL
status: 'live'
},
{
id: 'weather',
name: 'Weather',
description: '获取当前天气、预报和官方警报(NWS)',
icon: '/weather.png',
capabilities: ['get_current_weather', 'get_forecast', 'get_weather_alerts'],
url: 'https://your-weather-mcp.onrender.com/mcp', // 更新此URL
status: 'live'
},
{
id: 'github',
name: 'GitHub',
description: '访问GitHub存储库、问题、拉取请求等',
icon: '/github.png',
capabilities: ['get_repos', 'get_issues', 'get_pull_requests', 'search_code'],
url: 'https://your-github-mcp.onrender.com/mcp', // 更新此URL
status: 'live'
},
{
id: 'reddit',
name: 'Reddit',
description: '访问任何子版块的Reddit帖子、搜索和个人内容',
icon: '/reddit.png',
capabilities: ['get_subreddit_posts', 'search_reddit', 'get_user_posts'],
url: 'https://your-reddit-mcp.onrender.com/mcp', // 更新此URL
status: 'live'
},
{
id: 'spotify',
name: 'Spotify',
description: '搜索曲目、艺术家,并获取任何艺术家的热门曲目',
icon: '/spotify.png',
capabilities: ['search_tracks', 'search_artists', 'get_artist_top_tracks'],
url: 'https://your-spotify-mcp.onrender.com/mcp', // 更新此URL
status: 'live'
}
];
然后将前端部署到Vercel、Netlify或您首选的托管平台。
nextjs-marketplace(如果您的仓库有多个文件夹)next build(自动检测).next(自动检测)https://your-project-name.vercel.app 上线注意:当您向主分支推送更改时,Vercel会自动进行部署。
对于需要API密钥的每个MCP服务器,您需要在Render上添加环境变量:
GITHUB_TOKEN = your_github_tokenWEATHER_API_KEY = your_openweathermap_keyREDDIT_CLIENT_ID = your_reddit_client_id 和 REDDIT_CLIENT_SECRET = your_reddit_client_secretSPOTIFY_CLIENT_ID = your_spotify_client_id 和 SPOTIFY_CLIENT_SECRET = your_spotify_client_secret注意:Hacker News MCP不需要任何环境变量,因为它使用公共API。
要添加更多的MCP服务器,请编辑 app/page.tsx 并在 mcpServers 数组中添加:
{
id: 'new-server',
name: '新服务器',
description: '此处填写描述',
icon: '🔧',
capabilities: ['tool1', 'tool2'],
url: 'https://new-server.onrender.com/mcp',
status: 'live'
}