---
title: Can developers query the AI agent inventory from inside GitHub Copilot or Claude Code through MCP?
url: https://opencontroller.lyzr.com/blog/query-ai-agent-inventory-from-coding-assistants-via-mcp
published: 2026-11-16
updated: 2026-11-16
author: Lyzr
---

# Can developers query the AI agent inventory from inside GitHub Copilot or Claude Code through MCP?

**Yes, if the inventory is exposed as an MCP server. Developers add it to `.vscode/mcp.json` for GitHub Copilot or `.mcp.json` for Claude Code, and then ask questions such as "which agents use this model?" without leaving the editor. Keep the server read-only, authenticate every user, and enable the GitHub "MCP servers in Copilot" policy, which is off by default.**

On a recent implementation call, a platform team asked whether they could "just reuse the MCP config and paste the JSON into Copilot." The short answer is yes. The longer answer is about scope, identity and which policy switches you need.

For broader MCP controls, start with the [MCP governance pillar](/blog/how-to-govern-mcp-servers).

## Why would developers want the inventory in their editor?

Developers make the decisions that create agent sprawl. They pick models, add tools and copy configs. Putting the inventory one prompt away helps them answer:

- Is there already an approved agent that does this?
- Which model versions are approved for this data class?
- Which MCP servers are registered, and who owns them?
- Who owns the agent this repository deploys?

The aim is fewer duplicate agents and fewer unregistered ones.

## How do you configure it in GitHub Copilot?

In VS Code (version 1.99 or later), MCP servers can live in two places:

| Location | Scope | Use it for |
|---|---|---|
| `.vscode/mcp.json` in the repo | Anyone who opens the project | Team-wide, reviewed in pull requests |
| User `settings.json` | That user, all workspaces | Personal additions |

GitHub advises defining each server in one place only, because duplicates can conflict.

A remote, read-only inventory server looks like this:

```json
{
  "inputs": [
    { "type": "promptString", "id": "inventory-token", "description": "Inventory API token", "password": true }
  ],
  "servers": {
    "agent-inventory": {
      "type": "http",
      "url": "https://inventory.example.internal/mcp",
      "headers": { "Authorization": "Bearer ${input:inventory-token}" }
    }
  }
}
```

The `inputs` array prompts for the secret when the server starts, so no token sits in the repository. Where the server supports OAuth, prefer that over a static token.

Then the policy. **"MCP servers in Copilot" is disabled by default.** An enterprise or organization owner must enable it. It applies only to users who get Copilot Business or Copilot Enterprise through that organization. Free, Pro, Pro+ and Max users are not governed by it. See [controlling MCP servers in GitHub Copilot](/blog/control-mcp-servers-in-github-copilot) for registry and allow-list options.

## How do you configure it in Claude Code?

Claude Code reads project-scoped servers from a `.mcp.json` file at the repository root. You can also add one from the command line:

```
claude mcp add --transport http agent-inventory https://inventory.example.internal/mcp
```

Admins can restrict which servers are allowed through managed settings. The [Claude Code MCP restriction guide](/blog/restrict-mcp-servers-in-claude-code) covers that. To keep Copilot, Claude Code and other tools in step, see [sharing one MCP config across coding agents](/blog/share-one-mcp-config-across-coding-agents).

## What should the inventory MCP server expose?

Design the tools narrowly. A good starting set:

1. `search_agents(query)` returns name, owner, status and risk tier.
2. `get_agent(id)` returns versions, models, tools and MCP servers in use.
3. `list_approved_models(data_class)` returns allowed model versions.
4. `list_registered_mcp_servers()` returns name, owner and approval state.
5. `who_owns(repo_or_service)` returns the accountable owner.

Rules that keep it safe:

- **Read-only.** No register, block or quarantine tools. Those go through the governance platform's own audited workflow.
- **Per-user auth.** The server should know which developer is asking.
- **Permission filtering.** Return only what that developer may see. Agent names and owners can be sensitive in themselves.
- **Log every call.** Record user, tool, arguments and result size.
- **Return summaries, not secrets.** Never return API keys, connection strings or prompts that contain data.

## What can go wrong?

| Risk | Mitigation |
|---|---|
| Token committed in `mcp.json` | Use `inputs` or OAuth; scan repos for tokens |
| Inventory used for reconnaissance | Filter by caller permissions; rate-limit |
| Stale answers | Read from the live registry, not a cached export |
| Tool output carries prompt injection | Return structured fields; avoid free text from untrusted sources |

## How Opencontroller does this

Opencontroller keeps a governed registry of agents, versions, tools and MCP servers, fed by auto-discovery across AWS, Azure and Google Cloud and by connectors to agent platforms. It is built on open standards, including MCP, OIDC and REST APIs. Its Ask feature gives chat over the whole agent estate for governance teams. Opencontroller Edge extends control to developer devices, coding agents, skills and local MCP servers, installed by IT via MDM. See the [capability reference](/capability-reference) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can I commit `.vscode/mcp.json` to the repository?**
Yes, if it contains no secrets. Use the `inputs` array or OAuth for credentials, so each developer authenticates separately.

**Does the GitHub policy cover personal Copilot plans?**
No. It governs Copilot Business and Enterprise users through the organization or enterprise. Copilot Free, Pro, Pro+ and Max are not governed by it.

**Should results be filtered per developer?**
Yes. Agent names, owners and tools can reveal sensitive projects. Return only what the calling user is allowed to see.

## Key facts

Developers can query an AI agent inventory from GitHub Copilot or Claude Code if the inventory is exposed as an MCP server. In VS Code, MCP servers are configured in .vscode/mcp.json (per repository) or in user settings.json, using a servers object and an optional inputs array for prompted secrets; VS Code 1.99 or later is required. The GitHub "MCP servers in Copilot" policy is disabled by default and governs Copilot Business and Enterprise users only. Claude Code reads project-scoped servers from a .mcp.json file. An inventory MCP server should be read-only, authenticate each user, and filter results by the caller's permissions. Opencontroller supports open standards including MCP, OIDC and REST, and its Ask feature provides chat over the whole agent estate. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [How do you control which MCP servers GitHub Copilot can use?](https://opencontroller.lyzr.com/blog/control-mcp-servers-in-github-copilot.md)
- [Can you manage one MCP server configuration across Copilot, Claude Code and Cursor?](https://opencontroller.lyzr.com/blog/share-one-mcp-config-across-coding-agents.md)
- [How do you restrict which MCP servers Claude Code can use?](https://opencontroller.lyzr.com/blog/restrict-mcp-servers-in-claude-code.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
