Skip to content

MCP tool permissions not working after migration from tools to permissions #6892

Closed as not planned

Description

@Hipfox

Description

After the major change that merged tools into permissions, MCP tool permissions can no longer be controlled using the permissions configuration. The legacy tools configuration still works, but the new permissions configuration does not apply to MCP tools.

Working configuration (legacy tools field)

{  
  "$schema": "https://opencode.ai/config.json",  
  "mcp": {  
    "my-mcp": {  
      "type": "local",  
      "command": ["bun", "x", "my-mcp-command"],  
      "enabled": true  
    }  
  },  
  "tools": {  
    "my-mcp*": false  
  },  
  "agent": {  
    "my-agent": {  
      "tools": {  
        "my-mcp*": true  
      }  
    }  
  }  
}

Non-working configuration (new permissions field)

permissions:  
  "my-mcp*": allow

The permissions configuration should control MCP tools the same way the tools configuration did, but it appears that MCP tool patterns are not being properly evaluated in the new permissions system.

Expected Behavior
MCP tools should be controllable using the permissions field with glob patterns like "my-mcp*": allow or "my-mcp*": deny, just as they were with the tools field.

Context
This issue appears to be related to the permissions system overhaul that merged tools into permissions. The migration logic in packages/opencode/src/config/config.ts shows that legacy tools config should be converted to permission config, and the Permission schema includes a catchall pattern that should support arbitrary tool permissions.

However, it seems that MCP tool permissions are not being properly applied when using the new permissions configuration format.

Notes
The documentation shows examples of controlling MCP tools using the tools configuration mcp-servers.mdx, but there are no examples showing how to control MCP tools using the new permissions configuration. This suggests either a documentation gap or an implementation bug.

Wiki pages you might want to explore: https://opencode.ai/docs/mcp-servers/#per-agent

Plugins

No response

OpenCode version

v1.1.1

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. Hipfox commented on Jan 6, 2026

    @Hipfox
    Author

    Update: I just discovered that the issue might be caused by a typo in the field name. I tested it again using permission (singular) instead of permissions (plural), and it worked!
    With this correction, I can now successfully enable an MCP tool (which was globally disabled in opencode.json) within the YAML frontmatter of a specific agent markdown file like this:

    permission:  
      "my-mcp*": allow
    

    It seems the system expects the singular form permission in the frontmatter. Has anyone else encountered this, or is this the intended behavior?

    opencode v1.1.3

  2. einarpersson commented on Jan 10, 2026

    @einarpersson

    Yes! I was also confused by this. I used to have permissions and now it seems to be permission?

    sounds like a bug to me

  3. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. removed
    bugSomething isn't working
    on May 3, 2026
  5. sapient-engineer commented on May 12, 2026

    @sapient-engineer

    Same, the docs seem to be outdated and I cannot seem to get per agent MCP tool or skill permissions to work. The global settings in the config seem to overwrite everything and the usual last matching rule wins mentioned in the docs appears to be broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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