# Treat an MCP URL with an Access Token Like a Password

> Learn why an MCP URL containing an access token should be treated like a password, how public tunnels change exposure, and what to do if a credential leaks.

- URL: https://www.hemory.com/blog/tool-guides/mcp-token-url-security/
- Language: English (en)
- Author: Hemory Team
- Published: 2026-11-26
- Last updated: 2026-11-26
- Summary: An MCP URL containing an access token should be treated as a secret because anyone who obtains it may connect within the token’s permissions. A public tunnel broadens network reachability but does not determine what an authorized connection can do. Limit exposure, use supported access controls, and revoke or rotate a possibly leaked token. Hemory confirms an MCP server but does not document its authentication or security controls.
- Tags: MCP, access tokens, connection security, tunnels

An MCP connection URL can be more than an address. If it contains an access token, the URL may also carry a credential: someone who gets a copy could use it to connect, subject to the token's permissions and the server's configuration. A public tunnel can also make a server reachable from outside the device or network where it runs.

Treat a token-bearing URL as secret, and understand what becomes reachable before exposing a local server through a tunnel. The precautions are straightforward, but the actual risk depends on the connection's authentication, permissions, and network exposure.

## TL;DR

- If a connection URL contains an access token, keep the whole URL private. Anyone who obtains it may be able to use the credential within its permissions.
- A public tunnel changes who can reach a server; it does not, by itself, determine what a connection can access or do.
- Prefer a local connection when it fits the task. If a tunnel is necessary, restrict access and use the server's supported authentication and permission controls.
- If a token may have been exposed, use the provider's supported process to revoke or rotate it. Review access logs if they are available.

## Why a token-bearing URL should be treated like a password

A URL normally tells a client where to connect. If an access token is embedded in it, the URL may also provide the credential used to authorize that connection. Anyone who gets the complete URL could potentially use it as the configured client does, within whatever permissions the token grants.

That does not mean every token grants broad access, or that every MCP server uses token-bearing URLs. The consequences depend on the server's authentication and permission model. But unless you know the token is harmless or tightly scoped, handle the full URL as a secret—not just the token-shaped part.

URLs can be exposed accidentally when they are pasted into a chat, issue tracker, shared document, screenshot, or support request. Depending on the tools and environment, connection details may also remain in configuration files, command history, or logs. Avoid sharing the URL when a description of the problem or a redacted version will do.

## What changes when you expose a server through a public tunnel?

A tunnel can make a service running on one device reachable through a network address. If that address is public, people beyond the local machine or network may be able to attempt a connection. Whether they can connect successfully—and what they can do afterward—depends on authentication, access restrictions, and the server's available tools and permissions.

Reachability is not the same as authorization, and a public address does not prove that a server is unprotected. Still, exposing an endpoint creates another route to it. Use a tunnel only when the task requires one, and do not assume that an obscure URL or a temporary tunnel is a substitute for access controls.

Before enabling a tunnel, identify which server it exposes, who can reach it, and what an authorized client can access. Use the narrowest practical exposure and the authentication and permission controls supported by that server. If you do not know how those controls work, check the server's documentation before making the endpoint public.

## Practical precautions

### Keep the full connection URL private

Store connection details in the client or configuration location intended for secrets. Do not paste an unredacted URL into public messages, screenshots, tickets, or documentation. If someone needs to troubleshoot the connection, share a redacted copy that omits the token and other sensitive values.

### Prefer local connections when they meet the need

A local connection can avoid making the endpoint reachable over a public network. It does not eliminate every risk: someone with access to the device or its configuration may still find the connection details. Use the connection method that fits the task, and protect the machine and its secret storage as well.

### Limit exposure if a tunnel is necessary

Use the server's supported authentication and access restrictions, and expose only what the workflow requires. Avoid leaving a tunnel open longer than needed. Do not assume that a connection has limited permissions unless the server's documentation or settings establish that boundary.

### Respond promptly to possible disclosure

If a token-bearing URL was shared somewhere it should not have been, treat the credential as potentially exposed. Follow the server or provider's supported process to revoke or rotate it, then update the legitimate client configuration. If you cannot find a way to revoke or rotate the credential, consult the provider's documentation or support rather than assuming that deleting the message is enough.

Review access logs or connection history if the server provides them. Logs may help identify activity, but their absence does not prove that nobody used the credential. If the connection may have exposed sensitive data or tools, follow your organization's incident-response process.

## What to confirm before connecting

For any MCP server or client, find answers to these questions in its documentation or settings:

| Question | Why it matters |
|---|---|
| Does the connection URL contain a credential? | The whole URL may need to be handled as a secret. |
| What permissions does the credential grant? | This helps define the possible impact of disclosure. |
| Is the endpoint local or reachable over a network? | Network exposure affects who can attempt to connect. |
| Can access be restricted, and can the credential be revoked or rotated? | These controls help limit exposure and respond to leaks. |
| Are logs or connection history available? | They may help with a review after a suspected disclosure. |

Do not infer answers from the term “MCP,” from a client being listed as compatible, or from the presence of a tunnel. Connection steps and permissions can differ by server and client.

## What this means for Hemory MCP connections

Hemory's [Features page](/features/) describes a standard MCP Server and lists several agents that can connect, but it does not specify whether Hemory connection URLs contain access tokens or document token rotation, audit logs, or public-tunnel security settings. Do not assume those details from examples or from another MCP server. Check the current Hemory and client-specific connection instructions before deciding how to store or expose a connection.

## FAQ

### Is every MCP connection URL a password?

No. The URL is password-like when it contains a credential that can authorize access. If you are unsure whether it does, treat the complete connection detail as sensitive until the server documentation clarifies how authentication works.

### Is a public tunnel automatically unsafe?

Not necessarily. A tunnel makes a service reachable through a network route; the risk depends on who can reach it and what authentication and permissions protect it. Use one only when needed, with the server's supported access controls.

### Should I rotate a token after sharing the URL?

If the URL included a usable credential and was shared somewhere it could be accessed by others, follow the provider's guidance to revoke or rotate it. Deleting the shared copy may not remove copies already viewed, stored, or logged.

### Does Hemory use token-bearing MCP URLs or provide audit logs?

The available Hemory Features information confirms an MCP Server but does not specify its URL authentication method or whether MCP access logs and token controls are available. Check current Hemory documentation for those details rather than assuming how its connection works.

## The safe default

Treat an access-token URL as a credential, keep it out of places where others can retrieve it, and expose an MCP server only as broadly as the task requires. If a connection detail may have leaked, use the provider's supported revocation or rotation process and review available access records. For any specific server—including Hemory—confirm its current authentication and permission details instead of borrowing assumptions from another setup.

## Other language versions

- Japanese (ja): https://www.hemory.com/ja/blog/tool-guides/mcp-token-url-security/
- Korean (ko): https://www.hemory.com/ko/blog/tool-guides/mcp-token-url-security/
