五個(gè)開(kāi)源 MCP 服務(wù)器,讓你的AI代理勢(shì)如破竹
來(lái)源 | Code Pulse
出品 | 51CTO技術(shù)棧(微信號(hào):blog51cto)
我最近一直在研究Claude,我對(duì)它只是回答問(wèn)題感到有點(diǎn)厭煩。
我希望它能做一些事情,比如從網(wǎng)站拉取數(shù)據(jù),或者瀏覽我的 GitHub。當(dāng)我第一次讓一個(gè)MCP服務(wù)器運(yùn)行起來(lái)的時(shí)候,我非常興奮——感覺(jué)就像解鎖了一個(gè)外掛。
就在那時(shí),我發(fā)現(xiàn)了這種叫做 MCP 服務(wù)器的東西。它們就像小幫手,讓你的 AI 與工具和應(yīng)用程序交互。開(kāi)源、免費(fèi),而且說(shuō)實(shí)話,玩起來(lái)還挺有意思的。
這里分享我嘗試過(guò)的五款讓我“哇,這太棒了”的MCP服務(wù)器。
以下是我最近一直在研究的五個(gè)MCP服務(wù)器。
1.Stagehand:瀏覽網(wǎng)頁(yè)AI工具
Stagehand 是Browserbase推出的一款很酷的工具。它能讓你的 AI 像打開(kāi)瀏覽器一樣——點(diǎn)擊鏈接、抓取文本等等。我用它從一個(gè)美食博客上抓取了一堆菜譜標(biāo)題,用于一個(gè)項(xiàng)目,這比我自己寫(xiě)腳本容易多了。
git clone https://github.com/browserbase/stagehand-mcp
cd stagehand-mcp
npm install
npm start
它在 localhost:3000 上運(yùn)行。然后我告訴 Claude(使用 Claude Desktop,它非常適合這個(gè)功能):
Go to a news site and get the top headlines.Stagehand zipped over, snatched the titles, and Claude spit them back out. So handy for stuff like checking prices or pulling data without coding.to a news site andget the top headlines.Stagehand zipped over, snatched the titles, and Claude spit them back out. So handy for stuff like checking prices or pulling data without coding.
Stagehand是免費(fèi)且開(kāi)源的,并且不會(huì)像我嘗試過(guò)的其他一些網(wǎng)絡(luò)工具那樣崩潰。
圖片
2.Jupyter:輕松處理數(shù)據(jù)
這是給所有喜歡玩數(shù)字的人準(zhǔn)備的。Jupyter MCP 服務(wù)器可以讓你的 AI 處理 Jupyter 筆記本——你知道的,就是那些用于數(shù)據(jù)的編碼應(yīng)用程序。我不是數(shù)據(jù)科學(xué)家,但我讓 Claude 看了我在咖啡店消費(fèi)的 CSV 文件(說(shuō)實(shí)話,這挺尷尬的),然后告訴我發(fā)生了什么。
以下是設(shè)置方法:
git clone https://github.com/jjsantos01/jupyter-notebook-mcp
cd jupyter-notebook-mcp
pip install -r requirements.txt
python server.py
它在 localhost:8000 上運(yùn)行。比如我告訴 Claude:
Open coffee.csv and tell me how much I spent on lattes.and tell me how much I spent on lattes.
Claude做了一個(gè)筆記本,運(yùn)行了一些 Python 程序,然后說(shuō)道:
You dropped $87.50 on lattes this month. Ouch.87.50 on lattes this month. Ouch.
我不需要自己寫(xiě)任何代碼。就像有個(gè)書(shū)呆子朋友幫你算算賬一樣。
3.Opik:監(jiān)控你的AI
Opik 來(lái)自Comet,它專注于監(jiān)控你的 AI。比如,如果它開(kāi)始出現(xiàn)異常,Opik 會(huì)告訴你原因。我曾經(jīng)有一個(gè) AI 機(jī)器人總是給出愚蠢的答案,Opik 幫我發(fā)現(xiàn)它是不是觸及了某些 API 的極限。
安裝如下:
git clone https://github.com/comet-ml/opik
cd opik
./opik.sh
然后將其添加到一些代碼中:
import opik
opik.configure(use_local=True)
@opik.track
defask_something(question):
return"You asked: " + question
ask_something("What’s for dinner?")I asked Claude to check the logs:
Show me what my AI’s been up to.
它向我顯示了每個(gè)調(diào)用、時(shí)長(zhǎng)等等所有問(wèn)題。它就像你的人工智能的偵探,幫助你快速發(fā)現(xiàn)問(wèn)題。
圖片
4.GitHub:與你一起編碼的人工智能
這個(gè)服務(wù)器直接來(lái)自 GitHub,它可以讓你的 AI 深入挖掘你的代碼庫(kù)。我以前忙得不可開(kāi)交,需要查看項(xiàng)目進(jìn)度,又不想打開(kāi)無(wú)數(shù)個(gè)標(biāo)簽頁(yè)的時(shí)候就用過(guò)它。比如剛剛Claude還給了我一份未解決的問(wèn)題清單,超級(jí)有用。
設(shè)置如下:
git clone https://github.com/github/github-mcp-server
cd github-mcp-server
npm install
export GITHUB_TOKEN=your_token
npm start
它在 localhost:4000。我說(shuō):
Claude, what’s up with my repo ‘side-hustle’?
Claude的回答是:
Twoissuesopen: one’sabuginthelogin, another’saboutaddingasharebutton.
有了這個(gè)MCP服務(wù)器,就可以免于淹沒(méi)在GitHub的通知消息中。
5.FastAPI-MCP:你的AI調(diào)用你的API
FastAPI-MCP 是一個(gè)巧妙的技巧,可以將 FastAPI 應(yīng)用轉(zhuǎn)變?yōu)?AI 可以使用的工具。我創(chuàng)建了一個(gè)小型 API 來(lái)跟蹤我的待辦事項(xiàng)列表,這樣 Claude 就可以自動(dòng)檢查,無(wú)需我額外操作。
以下是我所做的:
git clone https://github.com/jlowin/fastmcp
cd fastmcp
pip install fastapi-mcpThen I tweaked my FastAPI app:
from fastapi import FastAPI
from fastmcp import mcp
app = FastAPI()
@app.get("/todo/{item_id}")
asyncdefget_todo(item_id: int):
return {"id": item_id, "task": f"Task {item_id}"}
@mcp.tool()
asyncdefget_todo_tool(item_id: int):
returnawait get_todo(item_id)
使用 uvicorn main:app — reload 運(yùn)行它,將其掛接到 localhost:8000,并告訴 Claude:
What’s task 5on my to-do list?Got back:
Task 5is “Call mom.”
為Claude制作自己的工具非常簡(jiǎn)單。
6.為什么這些值得你花時(shí)間
這些服務(wù)器我都用得非常開(kāi)心。Stagehand 非常適合處理網(wǎng)頁(yè)內(nèi)容,Jupyter 非常適合處理數(shù)據(jù),Opik 非常可靠,GitHub 是程序員的夢(mèng)想,而 FastAPI-MCP 則讓我可以構(gòu)建任何內(nèi)容。它們都是免費(fèi)的,而且如果你喜歡的話,還可以進(jìn)行一些調(diào)整。
這里有幾個(gè)使用心得,分享給大家。
- 先從聽(tīng)起來(lái)有趣的開(kāi)始。我首先選擇了 GitHub,因?yàn)槲铱偸窃谟?repos。
- 我使用 Claude Desktop 來(lái)測(cè)試這些東西。
- 檢查 GitHub 上每個(gè)服務(wù)器的自述文件 — — 它包含好東西。
- 在做大事之前先在本地嘗試一下。
參考鏈接:https://medium.com/@CodePulse/5-open-source-mcp-servers-thatll-make-your-ai-agents-unstoppable-89498fcada16
本文轉(zhuǎn)載自??51CTO技術(shù)棧??
