GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: serve internal MCP servers to chats in process by ethanndickson · Pull Request #29828 · coder/coder

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Sep 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This lets coderd give a chat MCP tools that it serves itself, in process. The first user will be an in-process integration, say a Slack bot. Nothing uses it yet.

coderd now takes a list of internal MCP servers when it's built, each with a slug and a ServerForChat function. At every step, chatd asks each one for a server for the chat and connects to it over an in-memory transport, so the server knows which chat it's serving without any headers. Nothing is stored on the chat, so the public API doesn't change, and the chat owner can't remove an internal server.

As only coderd can add one, internal servers ignore the chat-inline-mcp-servers experiment and the --disable-chat-caller-supplied-tools kill switch. Their tools come straight after the built-in tools, so they win any name clash with admin, workspace or caller tools. Admin and workspace tools now follow the same first-wins rule, so the model never sees two tools with the same name. If ServerForChat returns an error, we fail the turn, as we do when any other read during turn setup fails.

I've put this on top of #30730 and #30731 in the stack. It doesn't need anything from them, but the Slack bot needs all three.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@github-actions github-actions Bot assigned ethanndickson Sep 24, 2026
@ethanndickson
ethanndickson added this pull request to stack #29519 September 24, 2026 06:30
@ethanndickson

ethanndickson commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T04:13:20.118073Z 4429efd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 24, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9096f30e69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread coderd/util/xhttp/handlertransport.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 9096f30 to ac6b3b6 Compare September 24, 2026 14:23
@ethanndickson

ethanndickson commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 24, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac6b3b690a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread coderd/x/chatd/ARCHITECTURE.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread coderd/x/chatd/mcpclient/internalservers.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread coderd/util/xhttp/handlertransport.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson

ethanndickson commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 24, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3de198b989

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread coderd/util/xhttp/handlertransport.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 3de198b to 1d548b0 Compare September 25, 2026 05:18
@ethanndickson

ethanndickson commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 25, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24cb464c10

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread coderd/util/xhttp/handlertransport.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread coderd/coderd.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread coderd/x/chatd/generation_preparer.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch 2 times, most recently from b44c70e to 0e2a0cc Compare September 25, 2026 07:53
@ethanndickson

ethanndickson commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 0e2a0cc063

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson marked this pull request as ready for review September 25, 2026 08:09
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 0e2a0cc to ac3efcf Compare September 25, 2026 08:30
Base automatically changed from ethanndickson/chat-mcp-servers-feature to main September 25, 2026 08:52
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from ac3efcf to bb2bbce Compare September 25, 2026 08:52
@github-actions

github-actions Bot commented Sep 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

  • docs/ai-coder/agents/platform-controls/mcp-servers.md
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 11f8bf7 to fdbfefe Compare September 30, 2026 01:55
@ethanndickson
ethanndickson removed this pull request from stack #29519 September 30, 2026 08:19
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from fdbfefe to cbda0d0 Compare September 30, 2026 08:20
@ethanndickson
ethanndickson changed the base branch from main to ethanndickson/chat-create-as-user September 30, 2026 08:20
@ethanndickson
ethanndickson added this pull request to stack #30175 September 30, 2026 08:20
@ethanndickson ethanndickson changed the title feat(coderd): serve internal MCP servers to chats in process feat: serve internal MCP servers to chats in process Sep 30, 2026
@ethanndickson
ethanndickson added this pull request to stack #30732 October 19, 2026 03:47
@ethanndickson
ethanndickson marked this pull request as ready for review October 19, 2026 04:00
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 19, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4429efd3ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread coderd/x/chatd/internal_mcp_servers.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson

ethanndickson commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

@codex review

re: Add the required architecture TODO

Not adding one. The TODO in AGENTS.md is a note to the human author that the doc may need an update, and I've checked it. ARCHITECTURE.md has no tool-assembly or MCP connection section: MCP shows up only as the "MCP tools" bullet, the prepare/mcp_connect stage definitions, and the mcp-tool-search per-turn decision, and none of that text changes here. mcp_connect still only wraps the admin-configured servers, same as inline servers today. Inline servers, plan-mode MCP filtering and tool precedence aren't documented there either, so internal servers stay at the same level of detail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 4429efd3ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pr-queue-manager
pr-queue-manager Bot requested a review from ibetitsmike October 20, 2026 02:27
ibetitsmike
ibetitsmike approved these changes Oct 20, 2026
View reviewed changes
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 4429efd to 64ab6b2 Compare October 22, 2026 04:27
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 64ab6b2 to 3a09b37 Compare October 23, 2026 00:25
ethanndickson and others added 13 commits October 23, 2026 00:54
@ethanndickson
refactor(coderd): move the in-process handler transport into xhttp
ade60e1
@ethanndickson
feat(coderd): serve internal MCP servers to chats in process
d06189a
@ethanndickson
fix(coderd/util/xhttp): close request bodies and normalize empty paths
179e5f6
@ethanndickson
fix(coderd/util/xhttp): commit the response header on Flush
250b5a2
@ethanndickson
fix(coderd/util/xhttp): close the request body when the caller cancels
4b96446
@ethanndickson
fix(coderd): supply internal MCP servers before the chat worker starts
85617d8
@ethanndickson
fix: report inline MCP servers on the chat when the experiment is off
b1351e3
@ethanndickson
refactor(coderd): serve internal MCP servers to chats over an in-memo…
2d6f968
…ry transport

Internal MCP servers now return a go-sdk server for each chat, and chatd
connects to it over an in-memory transport at every step. This replaces
the coder-internal:// rows and the in-process HTTP handler transport.
@ethanndickson
refactor(coderd/x/chatd): give internal MCP servers their own path
134ebd9
Internal MCP servers no longer share the path of caller-supplied
servers. mcpclient gets an InProcessServer type and a ConnectInProcess
call, with their own caps at today's values. chatd keeps internal
servers in their own list, and adds tool sources in this order:
built-in, internal, admin, workspace, inline. The first tool keeps a
name, so internal tools win over admin and caller tools. Only the
admin and workspace tools that keep their names are deferred behind
find_tools.
@ethanndickson
fix(coderd/x/chatd): ask for internal MCP servers only when the turn …
93a9f50
…uses them

prepareGeneration called ServerForChat for every chat at every step,
then dropped the result for plan-mode subagents and explore-mode root
chats. turnUsesMCPServers now decides first, with the rule that
filterMCPServersForTurn and the explore-mode root filter apply, and
chatd skips the call when the turn uses no MCP servers.
@ethanndickson
fix(coderd/x/chatd): fail the turn when ServerForChat fails
c6cee04
An error from ServerForChat skipped the server for the step, and only
the debug run recorded it. It now fails turn preparation, as other
reads in turn preparation do, so the prepare retry runs and the chat
shows an error if the error stays. A nil server still means the chat
does not get that server.
@ethanndickson
test(coderd/x/chatd): fold internal MCP server tests into the chat ki…
798ca82
…nd table

InternalServer becomes the Root row of InternalServerByChatKind, which
now runs with caller-supplied tools disabled and the inline experiment
off, so every row also proves that internal servers ignore those gates.
Its caller server only repeated the Disabled test. The error half of
TestInternalMCPServersForChat repeats InternalServerError, and its
chat ID check repeats the Root row.
@ethanndickson
chore(coderd): trim and correct internal MCP server comments
7b30d05
@ethanndickson
ethanndickson force-pushed the ethanndickson/chat-mcp-servers-internal branch from 3a09b37 to 7b30d05 Compare October 23, 2026 00:57
@ethanndickson
fix(coderd/x/chatd/mcpclient): connect in-process MCP servers without…
b1cbdb7
… the turn actor

Tool handlers on an in-process server inherited the values of the context passed to Connect, which carried the chatd dbauthz actor. Connect with a background context so a handler must choose its identity explicitly, and database calls without one fail with ErrNoActor.
@ethanndickson
ethanndickson merged commit 15a160a into main Oct 23, 2026
29 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ethanndickson
ethanndickson deleted the ethanndickson/chat-mcp-servers-internal branch October 23, 2026 01:53
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@ibetitsmike ibetitsmike ibetitsmike approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ethanndickson ethanndickson

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ethanndickson @ibetitsmike
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.