Skip to content

Implement MCP for Pants #23234

@mattalbr

Description

@mattalbr

Is your feature request related to a problem? Please describe.
Our company's development is rapidly becoming more and more agent-based, and I suspect by EOY we'll have more code written by agents than by humans. As this shift accelerates, our tooling needs to better support automated systems interacting with the build environment.

Currently, Pants is optimized for human-driven workflows (CLI usage, manual iteration, etc.), which creates friction for agent-based development. Agents need a more structured, programmatic, and introspectable interface to interact with builds, understand failures, and make decisions. Without this, we’re seeing inefficiencies in debugging, slower iteration loops, and difficulty integrating Pants into autonomous workflows.

Describe the solution you'd like
Introduce MCP (Model Context Protocol) support for Pants to provide a standardized, machine-friendly interface for interacting with the build system.

This would ideally include:

  • Programmatic access to build graph information, targets, and dependencies
  • Structured outputs for build/test results (not just human-readable logs)
  • The ability to query and invoke Pants operations through MCP endpoints
  • Clear error surfaces that agents can interpret and act on

The goal is to make Pants a first-class participant in agent-driven development loops, enabling automated systems to efficiently reason about and interact with the build.

Describe alternatives you've considered

  • Wrapping the Pants CLI with custom scripts to parse output and simulate structured interactions
  • Building an internal service layer that proxies Pants commands and normalizes responses
  • Using existing APIs or plugins, though these tend to be limited or not designed for agent use cases

These approaches work to some extent but are brittle, require ongoing maintenance, and don’t provide the level of integration or standardization that MCP would.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions