Problem/Motivation

We want to add support for Tool API natively in the MCP product instead of relying on AI Function calls. This will mean being able to take full advantage of the MCP spec with mapping the additional metadata provided by Tool API tools.

Proposed resolution

Create an mcp_tool submodule, with a plugin that creates a 1:1 relationship for Tool API tools and MCP tools.

We will need to determine a path forward for normalizing Tool API inputs/outputs to match the MCP JSON schema spec. Right now we've been leaning on the AI module normalizer to make this work, but ideally we can solve it use the Drupal core/symfony normalizer capabilities. We also need to decide where this normalizer should live.

Later we can introduce other ways to surface Tool API tools to MCP. For example instead of a 1:1 relationship, provide 3 tools (Discover, Plan, Execute) that allows for dynamic tool discovery/usage, which will assist when a server needs to surface a large number of tools without overwhelming contexts.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Issue fork mcp-3552145

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

michaellander created an issue. See original summary.

michaellander’s picture

michaellander’s picture

Status: Active » Needs review

There are a few PHPStan flags that I'm not sure the best way to fix. The one about using \Drupal to get the tempstore service is intentional, however, as I would like to replace the token stuff with a common API that works across modules and don't want to tie the tempstore service into the dependency injection until a unified solution is in place.

gagosha made their first commit to this issue’s fork.

gagosha’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.