BitFun: treating MCP as a lifecycle, not just a tool list #830
bobleer
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.
Pre-submission Checklist
What would you like to share?
Maintainer disclosure: I work on BitFun.
BitFun is a Rust-based desktop agent for Windows, macOS, and Linux. We use MCP
to connect external capabilities, but the implementation problem that consumed
most of our attention was not parsing a tool schema. It was owning the full
server lifecycle without creating a second, inconsistent tool runtime.
What we built
config model rejects invalid local/remote transport combinations instead of
silently guessing.
reconnection, and tool publication. Multiple desktop windows can request
initialization without destructively restarting healthy servers.
MCP configuration and transport stay outside the agent loop; permission,
result persistence, previews, and artifact references stay in the shared tool
boundary.
temporary external session can be retired without tearing down unrelated
user configuration.
What was harder than expected
Configuration is not runtime state. A config file can say that a server is
enabled while the process is starting, waiting for auth, reconnecting, or has
already been superseded by a newer session. Publishing tools before that state
transition is complete leaves stale entries in the model-visible catalog.
The second boundary appeared when we added Agentic Mini Apps: task output can
become a persistent chart, board, form, or control panel instead of ending as a
transcript. We deliberately keep that UI/artifact layer separate from MCP. MCP
provides external capabilities; the Mini App is a session-bound presentation
and state surface, not another place that can bypass tool permissions.
What we learned
plugin build its own connection pool.
make cleanup idempotent.
concerns rather than pushing every byte back into the model context.
change depending on whether a tool is built in or came from MCP.
I would value feedback from other MCP host implementers on two questions:
individual tool call without making the protocol session own application
state?
behavior across stdio and Streamable HTTP servers?
Relevant Links
https://github.com/GCWing/BitFun/blob/bd47cc51659b2a0525fe05dc18ae7bb25ae51ef8/src/crates/services/services-integrations/src/mcp/server/mod.rs#L35-L65
https://github.com/GCWing/BitFun/blob/bd47cc51659b2a0525fe05dc18ae7bb25ae51ef8/src/crates/assembly/core/src/service/mcp/server/manager/lifecycle.rs#L175-L280
https://github.com/GCWing/BitFun/blob/bd47cc51659b2a0525fe05dc18ae7bb25ae51ef8/docs/architecture/agent-runtime-services-design.md#L639-L658
Your AI task should not end as a chat transcript GCWing/BitFun#2113
All reactions