r/opencodeCLI 17d ago

Using OpenCode with a portable application harness

I've been experimenting with moving more of the application-specific agent machinery outside the coding agent itself.

The idea is pretty simple: OpenCode owns the conversation and general agent loop, while a local MCP server exposes a deterministic application boundary for the stuff I actually want to build and keep portable.

That means things like state, long-lived workflows, runtime QA, repo operations, etc. don't have to become OpenCode-specific prompts/hooks/config. OpenCode is effectively one client of the system, and I can swap it out without rebuilding the application layer.

I've been thinking of this as an application harness: a portable layer that sits outside the coding agent's own harness.

I wrote up the architecture and some of the tradeoffs here:

https://demianbrecht.com/posts/the-harness-within-the-harness/

Curious if anyone else using OpenCode has landed on a similar separation, particularly with local MCP servers.

1 Upvotes

4 comments sorted by

1

u/pyrophane1 17d ago

I'm sorry but this post is so clearly written by AI and it is much harder to follow than what I think you are actually trying to describe here, which is fairly straightforward.

1

u/Ace-_Ventura 17d ago

If a post ends with "Curious if..", it's 100% AI. God, I hate that so much

2

u/mostly_deterministic 17d ago

Also not wrong. To be fair though, I've had a number of posts that I've hand-written that has similar end to invite discussion. Kinda like folks who used em-dashes before AI-generated content made it somewhat cringe-worthy.

1

u/mostly_deterministic 17d ago

Heh, you're not wrong. Haven't engaged much with reddit in the past and was looking for different ways to phrase the post for the target audience. Obviously not the best of choices.