Skip to content

RFC: codemode support for MCP-discovered tools and per-group type emission #1121

@KushGabani

Description

Hi! I wanted to ask about two related codemode capabilities that would make some MCP-based workflows much easier.

1) Codemode support for tools discovered from MCP servers

I’m working with tools discovered dynamically from one or more MCP servers, and I’d love a supported way to expose those through codemode while preserving app/server grouping.

Conceptually, I want generated code to look like:

await codemode.github.listIssues({ repo: "owner/repo" });
await codemode.gmail.sendEmail({ to, subject, body });

instead of everything being flattened into one tool namespace.

Is support for creating codemode APIs from MCP-discovered tools something that’s in scope / on the roadmap?

2) More control over generated types

It would also be very useful if codemode could emit type definitions per logical tool group/app, rather than only as one combined output.

For example, something like:

const typesByGroup = generateTypes(groupedTools);

// save independently
typesByGroup.github
typesByGroup.gmail
typesByGroup.notion

This would make it much easier to:

  • save generated types as files
  • cache them per app/server
  • regenerate only the groups that changed
  • compose multiple independently generated .d.ts fragments later

Is this kind of per-group type generation something you’d consider supporting?

Why I’m grouping these together

These asks feel closely related:

  1. MCP tool discovery naturally produces app/server-scoped tool groups
  2. per-group type output makes those grouped codemode APIs much easier to persist and reuse

Mainly asking for guidance here:

  • Is this aligned with codemode’s direction?
  • Is there a recommended pattern for doing this today if not?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions