Skip to content

RFC: thv serve as long-running, local process#34

Open
blkt wants to merge 3 commits intostacklok:mainfrom
blkt:feat/long-running-local-server
Open

RFC: thv serve as long-running, local process#34
blkt wants to merge 3 commits intostacklok:mainfrom
blkt:feat/long-running-local-server

Conversation

@blkt
Copy link
Contributor

@blkt blkt commented Jan 30, 2026

This is work in progress.

@blkt blkt self-assigned this Jan 30, 2026
@blkt blkt force-pushed the feat/long-running-local-server branch from 808ec5f to a1d5e63 Compare January 30, 2026 18:44
@blkt blkt changed the title RFC: thv serve as long-running HTTP server RFC: thv serve as long-running, local process Jan 30, 2026
@blkt blkt force-pushed the feat/long-running-local-server branch from a1d5e63 to 2321868 Compare January 30, 2026 18:45
Copy link
Member

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's a draft but definitely a +1 from me


## Non-Goals

- Modify existing API exposed by `thv serve`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will thv servers start expose the same APIs as thv serve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes, unless we have some API that breaks due to this separation.

As a rule of thumb, this RFC is not about adding features, but instead it's about designing a process that runs on the user's machine that can then hook into a remote API (if so configured).


**CLI (`thv`)**: Thin client for user interaction, command parsing, and communicating with the local server via HTTP API.

**Local Server (`thv-server`)**: Long-running process responsible for MCP server lifecycle, configuration management, file watching, and serving as single source of truth for local state.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is thv-server a new binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily, I don't have strong opinions.

The thv binary might just fork, although the whole binary containing both the CLI and the HTTP server could become pretty "fat", and I don't want to rule out any benefit (or issue) we might have producing a separate binary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest keeping it in the same binary for now since that eases distribution. We can revisit this later. wdyt?

@blkt blkt marked this pull request as ready for review February 2, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants