AI & Agents

Scoped MCP Servers: How to Restrict AI Agent Access by Workspace and Tool

Connecting autonomous AI agents to shared data without strict boundaries invites prompt injection vulnerabilities, data leakage, and unintended file modifications. Scoped MCP servers restrict agent connections by organization, workspace container, and tool capability. By isolating data into discrete containers and filtering tool manifests, teams prevent lateral browsing and maintain deterministic control over autonomous workflows.

Tom Langridge 17 min read Updated
Scoped MCP servers restrict AI agent access to designated workspace containers and tool sets.

Why Scoped MCP Servers Are Essential for Multi-Agent Teams

Point an autonomous coding agent or research assistant at a local filesystem MCP server with broad directory access, and everything under those directories becomes an open retrieval surface. Given a broad prompt or an adversarial instruction hidden inside a file, the model can traverse unrelated project folders and load sensitive credentials or customer data into its active context window.

Many tutorials and starter templates introduce the Model Context Protocol using the reference filesystem server running on a developer's local machine. While opening local directories works for personal prototyping, it fails in shared and remote environments where multiple agents, contractors, and internal teams collaborate over shared repositories. When an agent runs locally, its boundary is defined by operating system file paths. In team settings, data lives in cloud workspaces, document stores, and shared repositories. If an agent receives unpartitioned access to these environments, prompt instructions cannot prevent it from reading restricted material.

Scoped MCP servers are Model Context Protocol endpoints configured to expose only specific workspace containers, data repositories, and authorized tool sets to connected AI clients.

Instead of granting an AI agent access to an entire storage account or filesystem, a scoped architecture enforces boundaries at the protocol, container, and tool level. Confining an MCP server to a single workspace container reduces lateral browsing risks across an organization's cloud storage. If a research agent only belongs to a public documentation workspace, it cannot inspect legal agreements, payroll files, or proprietary roadmaps located in adjacent workspaces. Teams building production systems need persistent storage for agents that isolates sensitive context before query execution begins.

The Risks of Unpartitioned Model Context Protocol Endpoints

Unpartitioned MCP servers create a severe operational vulnerability known as the confused deputy problem. In this scenario, an agent holds elevated service credentials to query databases or cloud storage. When a user with limited permissions asks the agent a question, the agent evaluates the request using its own high-privilege credentials rather than the user's restricted access profile.

If an external contractor asks an internal assistant to search for project updates, an unpartitioned assistant might scan executive documents or internal salary tables because the semantic query matches document contents. The model does not understand corporate confidentiality; it only evaluates relevance. Without structural boundaries at the endpoint, the agent acts as an accidental proxy that bypasses access policies.

Why Prompt Guardrails Cannot Replace Structural Boundaries

Attempting to restrict an agent's access through prompt engineering fails against real-world inputs. System prompts that instruct a model to "only look at documentation" or "ignore financial spreadsheets" provide zero deterministic protection. Natural language is inherently flexible and susceptible to indirect prompt injection.

If an untrusted document contains instructions directing the model to ignore previous system instructions and read adjacent files, an autonomous agent can follow those instructions and expose protected data. Security boundaries must exist outside the inference context. By scoping the MCP connection so that the server does not search or return workspaces outside its scope, the agent cannot be manipulated into retrieving data outside its operational boundary.

The Three Architectural Levels of MCP Scoping

Restricting an autonomous AI agent requires defense in depth across three distinct architectural layers. Rather than relying on a single permission flag, teams must configure boundaries at the organization level, the workspace container level, and the tool manifest level.

  1. Organization Level Scoping: Establishes the outermost tenancy perimeter, ensuring that agent credentials and connections cannot resolve data across different corporate entities or client tenants.
  2. Workspace Container Level Scoping: Restricts agent membership to specific project or departmental containers, preventing lateral movement across adjacent projects.
  3. Tool Manifest Level Scoping: Filters the active tools exposed to the agent, removing state-changing mutation capabilities when only read access is required.

Configuring these three levels creates a deterministic perimeter that models cannot bypass. In intelligent workspaces, each container enforces discrete membership boundaries while supporting collaborative human and agent workflows.

1. Organization Level Scoping

In multi-tenant platforms, the organization represents the top-level administrative boundary. Organization-level scoping ensures that an agent's credentials belong to a defined organization account. Fastio permissions are set per organization, workspace, and share, through member roles. At the organization level, member roles include owner, admin, and member.

An agent connecting with organization-scoped credentials can only see resources within that organization. It cannot query across accounts or access data belonging to other organizations. If an agency manages workspaces for multiple enterprise clients, each client's assets live within separate organizational structures, keeping each client's data apart.

2. Workspace Container Level Scoping

Within an organization, data must be partitioned into discrete workspace containers rather than an unpartitioned directory tree. Fastio workspace roles include owner, admin, member, guest, and view. Every workspace member reaches the entire workspace according to their assigned role.

A workspace's join setting defaults to letting any member of its organization join. Keeping a workspace restricted to named people and specific agents requires explicitly restricting that setting. When an agent is provisioned for a task, it is assigned membership strictly in the designated workspace. If an agent needs to process marketing assets, it is added to the marketing workspace and excluded from the finance workspace. Because it holds no membership in finance, its search and retrieval tools cannot discover, query, or index financial documents.

3. Tool Manifest Level Scoping

The third scoping layer controls the tool definitions returned to the client during the Model Context Protocol capability negotiation phase. When an MCP client initializes a connection, the server advertises its available tools via the protocol's tools discovery method.

Tool manifest scoping dynamically filters this list based on the agent's authorization. If an agent is granted Read Only access, the server completely omits state-changing tools from the advertised manifest. If a tool like storage_manage or workspace_manage is not included in the manifest, the language model has no schema for it and cannot generate calls to modify, move, or delete files.

How to Scope Authentication: Interactive OAuth vs Headless API Keys

Implementing scoped MCP servers requires matching the authentication mechanism to the operational environment of the AI client. Human-facing interactive assistants and headless automated agents have fundamentally different authentication lifecycles. Interactive clients operate with human oversight in a desktop or browser application, while headless agents execute autonomously inside automated continuous integration jobs, background worker daemons, or server-side orchestration frameworks. Fastio remote MCP endpoints allow interactive clients to select exact workspaces during OAuth authentication while headless agents use scoped API keys.

By selecting the right authentication method for each client type, platform engineers enforce strict least privilege across every integration point. Interactive users select target workspaces through intuitive permission screens, while automated services rely on scoped API keys restricted to explicit operational boundaries.

Interactive OAuth Scoping for Human-Driven Clients

Interactive clients, such as Claude Desktop, the Claude web interface, mobile apps, and ChatGPT, connect to remote MCP servers using OAuth 2.0. During the OAuth connection handshake, the user is redirected to a browser-based authentication window.

Fastio's OAuth flow presents a Review Permissions screen where the user explicitly chooses:

  • Permission Level: The user selects either Read Only or Read & Write access.
  • Target Workspaces: The user selects the exact organizations and workspaces the connection can reach.

When a user selects a Read Only connection, tools that change data are not offered at all. Because write tools are excluded from the tool manifest, there is no 403, no insufficient_scope error, and no step-up flow during execution. The model never sees the mutation tools, eliminating execution errors and prompt injection vectors that attempt to force file edits.

Headless API Key Scoping for Automated Pipelines

Background automation agents running in continuous integration pipelines, scheduled cron tasks, or server environments operate headlessly without a human in the browser loop. These agents connect using scoped API keys sent over Streamable HTTP as an Authorization: Bearer <api key> header.

API keys carry explicit scopes and act with the permissions of the user who created them; they have no role of their own. If an administrator creates an API key scoped to a single project workspace with read-only permissions, the agent using that key cannot execute file uploads or modifications. Because the key acts with its creator's permissions, reducing the creator's role also reduces what the key can do.

Segregating Read Tools from Mutation Tools

To enforce least privilege at the tool level, the Fastio MCP server divides operations across dedicated read tools and mutation tools.

When connecting to https://mcp.fast.io/mcp/tools (used for Claude apps and general MCP clients), operational boundaries are split into distinct tool pairs:

  • Read Tools: storage, workspace, upload, and share handle read-only operations including searching files, listing directory contents, inspecting workspace details, and retrieving metadata.
  • Management Tools: storage_manage, workspace_manage, upload_manage, and share_manage handle state-changing actions such as deleting files, moving items, creating shares, and managing locks.

For coding agents connecting to https://mcp.fast.io/mcp/code, the available tools are auth, auth_manage, upload, upload_manage, search, execute, execute_manage, and how-to. The execute tool handles GET requests for inspecting data, while write and mutation actions are isolated to execute_manage. On a Read Only session, a write sent through a read tool is refused by the server.

Fastio features

Confine AI agent access to dedicated workspaces

Deploy scoped MCP servers over Streamable HTTP with container-level boundaries, citation-backed intelligence, and audit tracking. Monthly plans start with a 14-day free trial.

Permission-Aware Retrieval and Workspace Container Boundaries

Retrieval-augmented generation (RAG) is the primary mechanism through which AI agents access operational knowledge. Traditional enterprise search systems attempt to solve access control by attaching chunk-level access control lists (ACLs) to individual vector embeddings in a shared database.

At runtime, chunk-level filtering queries user permissions for every candidate passage retrieved from the vector index. This architecture introduces operational friction: permission changes in source systems require re-indexing millions of vector chunks, and any failure in query-time filtering leaks proprietary snippets into the model's active prompt.

Fastio avoids this failure mode with a container-based retrieval architecture. Permissions are set per organization, workspace, and share, through member roles. There are no folder-level or file-level permissions inside a workspace: every workspace member reaches the whole workspace according to their role. Search and Intelligence (semantic search, summaries, and chat with citations to files, pages, and snippets) answer only from the workspaces and shares the asking person or agent is a member of. The retrieval boundary is the workspace or share: material only some people or agents may see lives in its own workspace or share.

Cloud Sync and Permission Boundary Realignment

Organizations often maintain existing document repositories in Google Drive, Dropbox, Box, or OneDrive (including SharePoint document libraries accessed through the OneDrive connector). Fastio's Cloud Sync connects these external folders directly to a workspace, operating one-way or two-way, on a schedule or on demand. Cloud Sync never runs continuous, live, or real-time sync.

When files sync into a Fastio workspace, they inherit the destination workspace's container permissions. Source drive permissions, external sharing links, and inherited access lists do not carry over. What an agent can retrieve is decided strictly by Fastio workspace membership rather than by legacy sharing settings in the source system. If an external folder had overly permissive sharing in Google Drive, syncing it into a private Fastio workspace limits it to that workspace's members.

Advisory File Locks and Multi-Agent Versioning

In workflows where multiple agents or human teammates collaborate within the same workspace, concurrent file writes can cause race conditions. Fastio provides advisory per-file locks in workspace or share storage, managed via MCP actions: lock-acquire and lock-release on storage_manage, and lock-status on storage.

An advisory lock signals to other participants that an agent is actively working on a file. The lock expires automatically unless heartbeated by the holder. Crucially, an advisory lock never grants exclusive write rights or prevents writes: concurrent writes both land safely, and per-file version history preserves every version. Teammates and administrators can inspect previous versions and restore earlier states without data loss.

Auditing Structural Changes in the Activity Log

Verifying access control requires an accurate record of operational changes. Fastio provides a detailed activity log that records what changed and who changed it across the organization, covering actions by people and agents alike.

The activity log tracks file uploads, edits, moves, and deletions, along with membership adjustments, role changes, and share creation. It does not record read-only events such as views, downloads, opens, or previews. Security teams use the activity log to audit administrative events, such as when an agent was added to a workspace or when a public share was created, maintaining clear visibility into system configuration.

How to Configure Scoped MCP Servers in Claude Code and IDEs

Setting up a scoped MCP connection requires configuring your AI development client with the correct endpoint and transport protocol. The Fastio MCP server is hosted remotely at mcp.fast.io over Streamable HTTP. It does not require local npm packages, stdio bridges, or legacy transport adapters. Developers and system administrators can follow the official Fastio MCP setup documentation to connect their chosen client in minutes.

The remote server exposes dedicated client endpoints:

  • Claude apps (claude.ai, Claude Desktop, mobile, and Claude Cowork): https://mcp.fast.io/mcp/tools
  • ChatGPT and Codex: The Fastio plugin in the ChatGPT plugin directory is preferred; custom MCP servers use https://mcp.fast.io/mcp/operations
  • Coding agents (Claude Code, Cursor, Gemini CLI, Cline): https://mcp.fast.io/mcp/code

Consult the Fastio MCP skill reference for full action schemas and parameter contracts.

Connecting Claude Code via Streamable HTTP

In Claude Code, you can add the Fastio MCP server directly from your terminal using Streamable HTTP:

claude mcp add --transport http fast-io https://mcp.fast.io/mcp/code

Claude Code supports scoping configurations to control where server settings are stored:

  • Project Scope (--scope project): Saves the server configuration to .mcp.json at the root of your project repository, allowing team members to share the tool definition via version control.
  • Local Scope (--scope local): Saves the configuration private to your local environment in ~/.claude.json.

After adding the server, authenticate using claude mcp login fast-io to initiate browser-based OAuth authentication. Select your target workspace container and choose your permission level on the Review Permissions screen.

Configuring Cursor and IDE Clients

For IDE coding environments like Cursor, define the server connection in your project configuration at .cursor/mcp.json or your global configuration at ~/.cursor/mcp.json:

{
  "mcpServers": {
    "fast-io": {
      "url": "https://mcp.fast.io/mcp/code"
    }
  }
}

For VS Code and GitHub Copilot agent mode, configure .vscode/mcp.json under the "servers" key using "type": "http" and "url": "https://mcp.fast.io/mcp/code". For Cline, configure the connection with "type": "streamableHttp" and the /mcp/code URL.

Extracting Structured Context with Metadata Views

While semantic search through Intelligence Mode helps agents query unstructured text, autonomous workflows frequently need structured records from documents like contracts, invoices, and technical specs. Fastio provides Metadata Views, which turn workspace documents into queryable, typed databases.

Users and agents describe the required fields in natural language, and the system designs a schema supporting Text, Integer, Decimal, Boolean, URL, JSON, and Date & Time formats. Without templates or OCR rules, Metadata Views match documents across the workspace and populate structured tables. Agents can query these structured views through MCP tools, extracting exact operational figures without processing entire files.

Platform Plans and Subscription Options

Fastio provides an intelligent workspace platform designed for agentic teams and human collaboration. Monthly plans start with a 14-day free trial, which requires a credit card and ends early if trial credits run out.

Review current Fastio pricing and plans across standard organizational tiers:

Dimension Starter Business Enterprise
Monthly Subscription $9.99/mo $49.99/mo $199.99/mo
Included Team Seats 3 seats 10 seats 30 seats
Included Cloud Storage 250 GB 5 TB 25 TB
Workspace Allowance 5 workspaces 50 workspaces 200 workspaces
Monthly Intelligence Credits 100,000 600,000 3,000,000
Maximum File Upload Size 25 GB 50 GB 100 GB
Additional Seat Pricing Not applicable Not applicable $1/mo each, up to 200
Credit Overage Rate $10 per 100,000 credits $10 per 100,000 credits $10 per 100,000 credits

Credits meter AI work only. Storage beyond the plan is $0.015 per GB a month, and extra bandwidth is $0.04 per GB, billed in money.

Sources

References used to verify factual claims in this guide.

  1. An MCP host creates one MCP client for each MCP server, and each client maintains a dedicated connection with its server.

Frequently Asked Questions

How do you scope an MCP server?

Scope an MCP server by applying boundaries across three architectural layers: organization tenancy, workspace containers, and tool manifests. Restrict the agent's credentials to designated workspace containers so it cannot query adjacent projects, and filter the advertised tool manifest to expose only necessary read or write tools.

How do you restrict what folders an AI agent can access via MCP?

Fastio does not use folder-level or file-level permissions; permissions are set per organization, workspace, and share, by member role. To restrict an AI agent to specific files or a single folder, place that folder into a dedicated share or a separate workspace container, and grant the agent membership only to that specific container.

What is the difference between OAuth workspace scoping and headless API key scoping?

Interactive clients use OAuth 2.0 to authenticate through a browser, allowing users to select Read Only or Read & Write permissions and choose specific workspace containers on a Review Permissions screen. Headless agents authenticate via an Authorization: Bearer <api key> header over Streamable HTTP, using an API key that carries its own scopes and acts with the permissions of the user who created it.

What happens when an AI agent connects with Read Only permissions?

When an agent connects with a Read Only scope, the MCP server completely omits state-changing tools from the advertised tool manifest. Because mutation tools do not exist in the connection's schema, the agent cannot generate tool calls to modify, rename, or delete files, preventing prompt injection attacks from executing writes.

Does Cloud Sync preserve sharing permissions from Google Drive or OneDrive?

Cloud Sync connects external Google Drive, Dropbox, Box, or OneDrive folders to a Fastio workspace on a schedule or on demand. Source drive permissions and external sharing settings do not carry over. Synchronized files inherit the Fastio workspace's permissions, ensuring that legacy sharing links from external drives do not expose files to connected agents.

Can an AI agent bypass workspace boundaries using prompt injection?

Prompt injection manipulates language model reasoning but cannot bypass infrastructure-level boundaries. If an MCP server is scoped to a specific workspace container, the server will not search, index, or return documents from outside that container, regardless of adversarial instructions in the prompt or retrieved files.

Related Resources

Fastio features

Confine AI agent access to dedicated workspaces

Deploy scoped MCP servers over Streamable HTTP with container-level boundaries, citation-backed intelligence, and audit tracking. Monthly plans start with a 14-day free trial.