Conversation
|
fyi, dependent on both: |
3274f55 to
a9a4c26
Compare
a9a4c26 to
4707f2a
Compare
| ], | ||
| }); | ||
|
|
||
| // Fetch user-installed MCP servers from the PostHog backend |
There was a problem hiding this comment.
We should have a way to enable / disable these in the Twig UI, but the logic of fetching and injecting the MCP servers should live in the agent package, since then it'll run in Twig locally + also in the cloud runs
There was a problem hiding this comment.
Just want to make sure I understand correctly...
Currently, the PostHog Code app fetches the MCP server installations and the pre-configured PostHog MCP server from within the app, and passes it to the agent through the various session functions (e.g. resumeSession). This logic predates my changes, so I want to confirm before making any changes.
Are you suggesting that logic should be moved to the agent package?
There was a problem hiding this comment.
suggestion would be that since the state of these is stored on our backend, we’d pass to a task run something like a list of server urls, and then the agent package would fetch them and inject them into the claude agent sdk / codex
There was a problem hiding this comment.
reason for suggesting that is just that the only thing that runs in the cloud runs is the agent server, and the agent itself, we could keep the logic in the app if that makes more sense here, but we’ll need to reimplement it in the agent / agent server anyway for cloud runs, so we may as well centralise that logic and minimise the surface of what we pass to the agent (e.g just a list of urls)
There was a problem hiding this comment.
if that makes no sense whatsoever given the existing logic though, feel free to ignore!
4707f2a to
6f63e54
Compare
6f63e54 to
a4ee738
Compare
Change
Add support for external MCP integrations
Details
The backend runs on the main PostHog Django app. The agent sends requests to a proxy service there, which retrieves the relevant installation and stored credentials, manages authentication and security, and forwards the requests to the MCP server. The MCP server then streams the responses back or serve buffered JSON.
MCPs can be managed (installed, configured, uninstalled) from either
Twig > Settings > MCP Serversor in mainPostHog > Settings > MCP servers pages.