ByteAsk Embedded MCP is the open-source server behind ByteAsk Embedded Docs:
a source-grounded, page-cited evidence-retrieval MCP server for coding agents
(Claude Code, Codex, Cursor) that write firmware / driver / protocol code and need
exact facts — SunSpec points, register offsets, Modbus function codes, trip
thresholds, SCPI commands, API symbols.
It returns verbatim snippets with page citations — never an authored answer — and
when nothing is relevant enough it says no match rather than fabricate. Every
document is treated equally: no authority layer, no filters.
[!NOTE]
What's in this repo: the MCP server — tools, transports (stdio + Streamable
HTTP), bearer auth, DNS-rebinding protection, result rendering — plus a small,
pluggable retrieval interface.
What's not in this repo: the retrieval engine and the document corpus. How
documents are parsed, chunked, embedded, and ranked, and the licensed source
material itself, sit behind the SearchBackend
seam and power the hosted endpoint at https://mcp.byteask.ai/mcp. This repo ships
an in-memory SampleBackend (a few
illustrative, public-knowledge records) so the server runs out of the box.
Why
- Cited, or nothing. Every hit is verbatim source text with a section + page
citation. On a miss it returns an honest "no confident match" — it never invents a
register value.
- Built for coding agents. The tool descriptions and triggers are tuned so agents
call
search_docs reflexively the moment they see a hex literal, a Modbus code, an
IEEE clause, a SCPI verb, or an MCU part number — before answering from memory.
- Two transports, one server.
stdio for local agents, Streamable HTTP for hosted.
- Bring your own retrieval. The search engine is a two-method interface — swap in
anything behind
BYTEASK_BACKEND without touching the server.
- Zero-setup demo. The bundled
SampleBackend runs immediately. No API keys.
Quickstart
Requires Python ≥ 3.10 and uv.
That's it — the bundled SampleBackend serves a couple of illustrative records, so
search_docs works immediately. Run the offline tests with uv run pytest.
Connect a client
Hosted (no install)
The hosted server speaks Streamable HTTP at https://mcp.byteask.ai/mcp and is
backed by the full licensed corpus.
[Add to Cursor]
Claude Code:
Codex, Cursor, and other clients (mcp-remote)
Local (this repo)
The project-scoped .mcp.json registers the stdio server for clients
that read it. Manually, for Claude Code:
Tools
Input is natural language (or an exact identifier). Output is compact markdown.
Example output:
Plug in your own retrieval
The server depends only on a two-method interface
(backend.py):
Implement it, expose a factory make_backend(config) -> SearchBackend, and point the
server at it:
The exact return-value contracts are documented at the top of backend.py.
Configuration
All settings are environment variables (loaded from .env; see .env.example).
Running over HTTP
Clients then send Authorization: Bearer <token>. The bundled bearer check is a
shared-secret stub — replace it with real auth (OAuth 2.1 resource server, mTLS,
or a trusted reverse proxy) before exposing publicly. DNS-rebinding protection stays
on independently via MCP_ALLOWED_HOSTS.
Hosted server
You don't need to run anything to use ByteAsk Embedded Docs. The hosted server gives
Claude Code, Codex, Cursor, and any MCP client exact, page-cited facts from embedded
and firmware reference docs — register maps, protocol function codes, SCPI commands,
standard thresholds, datasheet specs. The guarantee: verbatim source, or "no match" —
never an invented value.
This repository is the open-source server that powers that endpoint.
Project layout
Security
- stdout stays clean in stdio mode (it is the JSON-RPC channel); all logs go to
stderr /
logs/*.jsonl.
- The HTTP bearer check is a stub — unauthenticated if no token is set, a shared
secret at best. Harden it before exposing widely.
- DNS-rebinding protection is on by default for the HTTP transport.
Contributing
PRs and issues are welcome.
A few conventions to keep the server clean:
- The backend seam is the extension point. Retrieval internals (parsing, chunking,
embeddings, ranking) are intentionally out of scope here — build them behind
SearchBackend in your own package, not in this repo.
- Keep the dependency surface small and the stdio path free of the HTTP stack.
- Add a test for new behavior; the suite is fully offline (no network, no keys).
License
MIT © ByteAsk