Declare upstream MCP servers for the Fentaris proxyUse
mcp(...) for new applications. It creates an McpServer wrapper around a transport and optionally configures display metadata, credentials, env injection, and isolation.
Quick Start
Options
name
Server identifier. It becomes the prefix for proxied tool names.
Server names must be stable and must not include
__.displayName
Human-readable label used in tool titles.
transport
Transport implementation used to connect to the upstream MCP server.
env
Static env map or resolver function by user.
auth
Credential binding used when the server needs bearer or header auth.
isolation
Optional isolation runtime for user-aware queueing or process isolation.
Methods
listTools(params?, user?)
Lists tools for the given user.
callTool(params, user?)
Calls a tool for the given user.
listResources(params?, user?)
Lists resources for the given user. Returns an empty resources array when the underlying transport does not implement resource listing.
readResource(params, user?)
Reads a resource for the given user. Throws when the underlying transport does not implement resource reading.
listResourceTemplates(params?, user?)
Lists resource templates for the given user. Returns an empty resourceTemplates array when unsupported.
listPrompts(params?, user?)
Lists prompts for the given user. Returns an empty prompts array when unsupported.
getPrompt(params, user?)
Gets a prompt for the given user. Throws when unsupported.
complete(params, user?)
Forwards MCP argument completion for prompt and resource references. Throws when unsupported.
supportsResources(), supportsPrompts(), supportsCompletions()
Returns whether the configured transport exposes the corresponding optional methods. McpProxy uses these checks to advertise downstream capabilities.
close()
Closes all transports, including user-specific ones.
Low-Level Constructor
The class constructor is available for advanced integrations:mcp(name, options).