Scoped Support Tools Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Scoped Support Tools Serverprocess refund for order 12345"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Secure AI Application
This project demonstrates two versions of an AI customer support application that uses MCP tools with a LangChain agent:
unsecure-ai-agent: an MCP server with no authentication or per-tool authorization.secure-ai-agent: an MCP server protected with Descope-issued JWTs and explicit scope checks on sensitive tools.
The app is intentionally small and uses an in-memory mock support database so the difference between insecure and secure tool access is easy to see.
What This Project Shows
The support agent can use MCP tools to answer customer support questions, look up customer data, look up orders, get product information, and process refunds.
The unsecure version exposes tools directly. Any client that can reach the MCP endpoint can call the tools exposed by the server.
The secure version protects the MCP endpoint with Descope JWT authentication. Tools require scopes, and the refund tool requires the additional refunds:create scope.
Related MCP server: ToolBridge
Project Structure
.
├── pyproject.toml
├── uv.lock
├── unsecure-ai-agent/
│ ├── api/index.py
│ ├── customer_support_agent.py
│ ├── mcp_server.py
│ └── tools.py
└── secure-ai-agent/
├── api/index.py
├── customer_support_secure.py
├── secure_mcp_server.py
└── tools.pyMain Components
MCP Servers
unsecure-ai-agent/mcp_server.py creates a FastMCP server named Support Tools Server and exposes these tools:
answer_user_queryprocess_refundget_order_idlookup_customer_infolist_customersget_product_info
secure-ai-agent/secure_mcp_server.py creates a FastMCP server named Scoped Support Tools Server and protects it with Descope JWT verification. It exposes these scoped tools:
answer_user_query: requiressupport:toolsprocess_refund: requiressupport:toolsandrefunds:createget_order_id: requiressupport:toolslookup_customer_info: requiressupport:toolsget_product_info: requiressupport:tools
The secure version intentionally does not expose list_customers, which limits broad customer data access.
Agent Clients
unsecure-ai-agent/customer_support_agent.py connects to an MCP server using MCP_SERVER_URL, loads the available tools, and runs a LangChain/Groq support agent.
secure-ai-agent/customer_support_secure.py gets or uses a Descope access token, connects to the secure MCP server with an Authorization: Bearer <token> header, loads the scoped tools, and runs a LangChain/Groq support agent.
Mock Data
Both tools.py files use in-memory dictionaries for customers, orders, refunds, and products. Data resets when the server process restarts.
Requirements
Python 3.11 or newer
uvfor dependency installation and running scriptsA Groq API key for the LangChain chat model
A Descope project and MCP application/server configuration for the secure version
Vercel account for deployment
Use this Descope setup link for this project:
https://descope.plug.dev/RPSqEGs
Install Dependencies
From the repository root:
uv syncThis installs the dependencies from pyproject.toml and uv.lock.
Local Environment Variables
Create a local .env file in the repository root for local runs.
Do not commit real secrets. If secrets have already been committed, rotate them in the provider dashboard.
Shared Local Variables
GROQ_API_KEY=your_groq_api_key
MCP_SERVER_URL=http://localhost:8000/mcpGROQ_API_KEY is used by ChatGroq.
MCP_SERVER_URL is used by the unsecure client to connect to the MCP server. For a deployed server, set this to the Vercel /mcp URL.
Secure Local Variables
The secure MCP server requires these values:
DESCOPE_PROJECT_ID=your_descope_project_id
DESCOPE_MCP_SERVER_ID=your_descope_mcp_server_or_audience_idOptional secure server overrides:
DESCOPE_BASE_URL=https://api.descope.com
DESCOPE_JWKS_URI=https://api.descope.com/<DESCOPE_PROJECT_ID>/.well-known/jwks.json
DESCOPE_ISSUER=https://api.descope.com/<DESCOPE_PROJECT_ID>The secure client can also use:
DESCOPE_ACCESS_TOKEN=existing_access_token_for_testing
DESCOPE_TOKEN_ENDPOINT=https://your-token-endpointDESCOPE_ACCESS_TOKEN skips the client credentials request and uses the provided token directly.
DESCOPE_TOKEN_ENDPOINT overrides discovery from the OpenID configuration URL.
Run Locally
Run The Unsecure MCP Server
uv run python unsecure-ai-agent/mcp_server.pyThe server exposes the MCP app at /mcp.
Run The Unsecure Agent Client
In another terminal, set MCP_SERVER_URL to the running MCP endpoint, then run:
uv run python unsecure-ai-agent/customer_support_agent.pyRun The Secure MCP Server
Set the required Descope variables first:
export DESCOPE_PROJECT_ID=your_descope_project_id
export DESCOPE_MCP_SERVER_ID=your_descope_mcp_server_or_audience_id
uv run python secure-ai-agent/secure_mcp_server.pyThe server exposes the protected MCP app at /mcp.
Run The Secure Agent Client
Make sure the secure client has a valid Descope token flow or a DESCOPE_ACCESS_TOKEN, then run:
uv run python secure-ai-agent/customer_support_secure.pyDeploy To Vercel
The Vercel entrypoint for each server is the api/index.py file in that server directory:
unsecure-ai-agent/api/index.pyimportsappfrommcp_server.py.secure-ai-agent/api/index.pyimportsappfromsecure_mcp_server.py.
Deploy the secure and unsecure servers as separate Vercel projects so each deployment has its own root directory and environment variables.
Recommended setup:
Project 1 root directory:
unsecure-ai-agentProject 2 root directory:
secure-ai-agentProduction endpoint path for both:
/mcp
If Vercel does not automatically install dependencies from the root pyproject.toml, add a requirements.txt or configure the Vercel install command for the selected project.
Vercel Environment Variables
Set environment variables in Vercel from:
Vercel Project -> Settings -> Environment Variables
Add variables to the correct environments, usually Production, Preview, and Development if you use all three.
Required For The Secure Vercel MCP Server
These variables must be set on the Vercel project that deploys secure-ai-agent:
Variable | Required | Example | Description |
| Yes |
| Descope project ID used to build the default issuer and JWKS URL. |
| Yes |
| Expected JWT audience for this MCP server. This must match the audience/resource configured in Descope. |
| No |
| Base Descope API URL. Defaults to |
| No |
| JWKS URL used to verify token signatures. Defaults from |
| No |
| Expected JWT issuer. Defaults from |
The secure Vercel server will fail at startup if DESCOPE_PROJECT_ID or DESCOPE_MCP_SERVER_ID is missing.
Required For The Unsecure Vercel MCP Server
The unsecure MCP server does not currently require any environment variables on Vercel.
Variable | Required | Description |
None | No | The server uses only the mock in-memory data from |
Variables For Running Agent Clients Against Vercel
These are needed wherever you run the client scripts. They are not required by the MCP server itself unless you also deploy the client logic.
Variable | Used By | Required | Description |
| Both clients | Yes | API key used by |
| Unsecure client | Yes | Full MCP endpoint, for example |
| Secure client | No | Existing bearer token. Useful for testing without requesting a new token. |
| Secure client | No | Overrides token endpoint discovery. |
The secure client also needs Descope client credentials and the well-known configuration URL. These values are loaded from environment variables and should be set locally in .env or in the environment where the client runs.
Recommended production secure-client variables:
DESCOPE_WELL_KNOWN_URL=https://api.descope.com/v1/apps/agentic/<project-id>/<server-id>/.well-known/openid-configuration
DESCOPE_REQUIRED_SCOPES=support:tools refunds:create
DESCOPE_TOKEN_RESOURCE=https://your-secure-project.vercel.app/mcp
DESCOPE_CLIENT_ID=your_descope_client_id
DESCOPE_CLIENT_SECRET=your_descope_client_secretDescope Scope Configuration
Use this Descope setup link for the project configuration:
https://descope.plug.dev/RPSqEGs
The secure MCP server expects JWTs that satisfy these checks:
Token signature validates against the configured JWKS URI.
Token issuer matches
DESCOPE_ISSUER.Token audience matches
DESCOPE_MCP_SERVER_ID.Token includes
support:toolsfor normal support tools.Token includes both
support:toolsandrefunds:createforprocess_refund.
When creating the Descope application or machine-to-machine client, make sure the issued token includes the scopes required for the tools you want the agent to call.
Security Notes
Never commit real API keys, client secrets, access tokens, or passwords.
Store production secrets in Vercel Environment Variables.
Rotate any secret that was accidentally committed or shared.
Use the secure MCP server for sensitive operations such as refunds.
Keep high-risk tools behind narrow scopes like
refunds:create.Avoid exposing broad tools such as
list_customersunless the caller is explicitly authorized.
Troubleshooting
Missing required environment variable: DESCOPE_PROJECT_ID
Set DESCOPE_PROJECT_ID in Vercel or in your local shell before starting secure-ai-agent/secure_mcp_server.py.
Missing required environment variable: DESCOPE_MCP_SERVER_ID
Set DESCOPE_MCP_SERVER_ID in Vercel or in your local shell. This value must match the expected JWT audience.
401 Unauthorized Or Tool Calls Fail On The Secure Server
Check that the token was issued by the configured Descope issuer, uses the correct audience, and includes the required scopes.
Refund Tool Is Not Available
The access token probably does not include refunds:create. Add that scope in Descope and request it when getting the token.
Groq Authentication Fails
Set GROQ_API_KEY in the environment where the client script runs.
Useful Commands
uv sync
uv run python unsecure-ai-agent/mcp_server.py
uv run python unsecure-ai-agent/customer_support_agent.py
uv run python secure-ai-agent/secure_mcp_server.py
uv run python secure-ai-agent/customer_support_secure.pyThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for enterprise authentication and authorization — JWT validation, OIDC token inspection, OAuth 2.0 introspection, and role-based access control for AI agents.Last updated8MIT
- Flicense-qualityCmaintenanceA governed MCP server for integrating AI agents with customer data, featuring role-based access control, field redaction, and human-in-the-loop approval for secure support operations.Last updated1
- Alicense-qualityCmaintenanceEnables AI agents to securely perform privileged actions like creating GitHub issues by minting short-lived, single-purpose tokens on demand, with policy enforcement and audit logging.Last updatedMIT
- Alicense-qualityCmaintenanceEnables AI assistants to manage customer support for a fictional candle shop, including order lookup, customer file access, and safe refund processing with server-side safety rules.Last updatedMIT
Related MCP Connectors
Guardrailed FHIR access for AI agents: PHI redaction, audit trail, step-up auth, tenant isolation
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Pay-per-call cybersecurity for AI agents: vuln scans, threat intel, compliance, code security.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AIwithhassan/agentic-ai-security'
If you have feedback or need assistance with the MCP directory API, please join our Discord server