Repository navigation
A client-only FastMCP 4 example: search and read EVM RPC docs #6346
gjwang
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I maintain BlockVectra. This is a small client-only FastMCP example for searching our EVM RPC docs and reading a page, without an LLM, account, or API key.
Use Python 3.11+ (
asyncio.timeout), install the client extra, save the script below asfastmcp_docs.py, and run it:python -m pip install 'fastmcp-slim[client]==4.1.6' python fastmcp_docs.pyThe endpoint exposes
search_docsandread_doc. The script checks that scope, searches for the English Quickstart, then reads that page. It prints both results, including the documentation text. It does not execute RPC commands shown in the returned documentation.With Python 3.13, FastMCP 4.1.6 and MCP 2.3.0, the default connection negotiated protocol
2026-07-28usingserver/discover; discovery, listing and the two calls returned HTTP 200. This is a direct client example; a model or agent loop is optional.For an intentional QA run, set
BLOCKVECTRA_INTERNAL_QA=1to append the QA User-Agent marker. Connection guide.LangChain migration: the same FastMCP client
Model-free example using the current langchain.mcp API
For anyone migrating from
langchain-mcp-adapters, here’s a small remote-docs example usinglangchain.mcp.MCPAdapter. It calls the adapted LangChain tools directly, so you can check discovery and tool results before adding a model. No LLM credentials or local MCP server are needed.The test server is BlockVectra’s documentation endpoint, which I maintain:
https://docs.blockvectra.com/mcp/docs. Its two tools aresearch_docsandread_doc; this example does not call blockchain RPCs or create an account.Prefer running the published example to copying the snippet? With Python 3.11+ and uv, no clone is needed:
The URL fixes the script version; its inline metadata declares the dependencies.
Python 3.11+:
Save as
langchain_docs.py, then runpython langchain_docs.py:The explicit
ToolCallinputs give backToolMessageobjects, so the example checksstatusbefore continuing. It also checks the search result before reading the matching quickstart page.The November 7 request-audit run of this SDK call flow negotiated protocol
2026-07-28, received four HTTP 200 responses, and completed both tools. This update makes its QA marker opt-in withBLOCKVECTRA_INTERNAL_QA=1; that header change was checked offline, without another endpoint run.langchain.mcpis still beta: the warning is left visible, and these are the versions tested, not a promise about future releases. The old package’s README points to the official migration guide.Remote connection guide
Pydantic AI: a runnable two-tool example
For Pydantic AI projects, there is now a small runnable example using
MCPToolset. With Python 3.11+ and uv, no clone is needed:It pins
pydantic-ai-slim[mcp]==2.66.0,fastmcp==4.1.6andmcp==2.3.0. The pinned example completed tool discovery,search_docsandread_docagainst the docs endpoint and prints the page in JSON. It runs no model and needs no account or API key. The toolset closes on success or failure; unexpected tools, search errors and empty text stop the run. This checks the client/documentation path, not a model-driven workflow or a chain RPC.All reactions