Dynamic MCP Power
This power teaches an agent how to leverage a registry of MCP server tools without the overhead of having to pre-start servers and pre-load all tool descriptions into model context. It can also be used with MCP "code mode" where an AI agent can write programs that stich together local MCP tool calls.
Use the mcp-cli CLI to access a list of configured MCP servers.
Use the mcp tools CLI to dynamically start and invoke tools.
Onboarding
To use this power, ensure you have the following prerequisites installed:
mcp-cli - you can install the binary (written in go) from the GitHub releases page.
mcp tools cli - You can install it using HomeBrew
brew tap f/mcptools brew install mcp
Discovery
Use the mcp-cli tool to look up available mcp servers using the mcp-cli ls -acd command.
List all available servers and commands to start them
mcp-cli ls -acd
NAME COMMAND DESCRIPTION
time uvx mcp-server-time --local-timezone America/New_York Provides current time and timezone utilities. aws-agentcore FASTMCP_LOG_LEVEL=ERROR uvx awslabs.amazon-bedrock-agentcore-mcp-server@latest Amazon Bedrock AgentCore platform documentation and management
Invocation
Invoke MCP server tools via the mcp CLI.
One-Shot Calls
List available tools from servers using the server commands exposed by mcp-cli ls -acd
mcp tools <server-command>
Call a tool
mcp call <tool-name> -p '<json-args>' <server-command>
With longer timeout for slow servers (default 30s)
mcp call -t 60 <tool-name> -p '<json-args>' <server-command>
Environment Variables
The mcp tools command does not currently support inline envvars (when not using containers), so you'll need to export them first. For example, instead of:
mcp tools AWS_REGION=us-east-1 FASTMCP_LOG_LEVEL=ERROR uvx awslabs.aws-api-mcp-server@latest
You'll need to run:
export AWS_REGION=us-east-1; export FASTMCP_LOG_LEVEL=ERROR; mcp tools uvx awslabs.aws-api-mcp-server@latest
For container-based servers, you can pass them inline. For example:
mcp tools docker run -i --rm -e AWS_REGION=us-east-1 -e FASTMCP_LOG_LEVEL=ERROR -v $HOME/.aws:/app/.aws public.ecr.aws/awslabs-mcp/awslabs/aws-api-mcp-server
Examples
mcp tools npx -y @modelcontextprotocol/server-filesystem /tmp mcp call read_file -p '{"path": "/tmp/test.txt"}' npx -y @modelcontextprotocol/server-filesystem /tmp mcp tools uvx mcp-server-git mcp tools docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=xyz ghcr.io/github/github-mcp-server
Clean Output
Disable ANSI color codes with NO_COLOR=1 :
NO_COLOR=1 mcp call InternalSearch -p '{"query": "test"}' aim mcp start-server builder-mcp