MCPcopy Index your code
hub / github.com/f/mcptools

github.com/f/mcptools @v0.7.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.1 ↗ · + Follow
207 symbols 659 edges 42 files 158 documented · 76%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MCP Tools

Swiss Army Knife for MCP Servers

A comprehensive command-line interface for interacting with MCP (Model Context Protocol) servers.



Discover, call, and manage tools, resources, and prompts from any MCP-compatible server.



Supports multiple transport methods, output formats, and includes powerful mock and proxy server capabilities.

Blog Post

Table of Contents

Overview

MCP Tools provides a versatile CLI for working with Model Context Protocol (MCP) servers. It enables you to:

  • Discover and call tools provided by MCP servers
  • Access and utilize resources exposed by MCP servers
  • Create mock servers for testing client applications
  • Proxy MCP requests to shell scripts for easy extensibility
  • Create interactive shells for exploring and using MCP servers
  • Scaffold new MCP projects with TypeScript support
  • Format output in various styles (JSON, pretty-printed, table)
  • Guard and restrict access to specific tools and resources
  • Support all transport methods (HTTP, stdio)

MCP Tools Screenshot

Installation

Using Homebrew (for macOS)

brew tap f/mcptools
brew install mcp

❕ The binary is installed as mcp but can also be accessed as mcpt to avoid conflicts with other tools that might use the mcp command name.

From Source (for Windows and GNU/Linux)

go install github.com/f/mcptools/cmd/mcptools@latest

❕ The binary will be installed as mcptools when but can be aliased to mcpt for convenience.

Screenshot 2025-05-05 at 22 21 29

Windows 11 Running Example

Getting Started

The simplest way to start using MCP Tools is to connect to an MCP server and list available tools:

# List all available tools from a filesystem server
mcp tools npx -y @modelcontextprotocol/server-filesystem ~

# Call a specific tool
mcp call read_file --params '{"path":"README.md"}' npx -y @modelcontextprotocol/server-filesystem ~

# Open an interactive shell
mcp shell npx -y @modelcontextprotocol/server-filesystem ~

Features

MCP Tools supports a wide range of features for interacting with MCP servers:

Usage:
  mcp [command]

Available Commands:
  version       Print the version information
  tools         List available tools on the MCP server
  resources     List available resources on the MCP server
  prompts       List available prompts on the MCP server
  call          Call a tool, resource, or prompt on the MCP server
  get-prompt    Get a prompt on the MCP server
  read-resource Read a resource on the MCP server
  shell         Start an interactive shell for MCP commands
  web           Start a web interface for MCP commands
  mock          Create a mock MCP server with tools, prompts, and resources
  proxy         Proxy MCP tool requests to shell scripts
  alias         Manage MCP server aliases
  configs       Manage MCP server configurations
  new           Create a new MCP project component
  help          Help about any command
  completion    Generate the autocompletion script for the specified shell

Flags:
  -f, --format string   Output format (table, json, pretty) (default "table")
  -h, --help            help for mcp
  -p, --params string   JSON string of parameters to pass to the tool (for call command) (default "{}")

Use "mcp [command] --help" for more information about a command.

Transport Options

MCP Tools supports multiple transport methods for communicating with MCP servers:

Stdio Transport

Uses stdin/stdout to communicate with an MCP server via JSON-RPC 2.0. This is useful for command-line tools that implement the MCP protocol.

mcp tools npx -y @modelcontextprotocol/server-filesystem ~

HTTP SSE Transport

Uses HTTP and Server-Sent Events (SSE) to communicate with an MCP server via JSON-RPC 2.0. This is useful for connecting to remote servers that implement the MCP protocol.

mcp tools http://localhost:3001/sse

# Example: Use the everything sample server
# docker run -p 3001:3001 --rm -it tzolov/mcp-everything-server:v1

Note: HTTP SSE currently supports only MCP protocol version 2024-11-05.

Output Formats

MCP Tools supports three output formats to accommodate different needs:

Table Format (Default)

mcp tools npx -y @modelcontextprotocol/server-filesystem ~

The default format now displays tools in a colorized man-page style:

read_file(path:str)
     Read the complete contents of a file from the file system.
read_multiple_files(paths:str[])
     Read the contents of multiple files simultaneously.
list_dir(path:str)
     Lists the contents of a directory.
write_file(path:str, content:str)
     Writes content to a file.
grep_search(pattern:str, [excludePatterns:str[]])
     Search files with pattern.
edit_file(edits:{newText:str,oldText:str}[], path:str)
     Edit a file with multiple text replacements

Key features of the format: - Function names are displayed in bold cyan - Required parameters are shown in green (e.g., path:str) - Optional parameters are shown in yellow brackets (e.g., [limit:int]) - Array types are indicated with [] suffix (e.g., str[]) - Object types show their properties in curly braces (e.g., {prop1:type1,prop2:type2}) - Nested objects are displayed recursively (e.g., {notifications:{enabled:bool,sound:bool}}) - Type names are shortened for readability (e.g., str instead of string, int instead of integer) - Descriptions are indented and displayed in gray - Parameter order is consistent, with required parameters listed first

JSON Format (Compact)

mcp tools --format json npx -y @modelcontextprotocol/server-filesystem ~

Pretty JSON Format (Indented)

mcp tools --format pretty npx -y @modelcontextprotocol/server-filesystem ~

Commands

MCP Tools includes several core commands for interacting with MCP servers:

List Available Tools

mcp tools npx -y @modelcontextprotocol/server-filesystem ~

List Available Resources

mcp resources npx -y @modelcontextprotocol/server-filesystem ~

List Available Prompts

mcp prompts npx -y @modelcontextprotocol/server-filesystem ~

Call a Tool

mcp call read_file --params '{"path":"/path/to/file"}' npx -y @modelcontextprotocol/server-filesystem ~

Call a Resource

mcp call resource:test://static/resource/1 npx -y @modelcontextprotocol/server-everything -f json | jq ".contents[0].text"

or

mcp read-resource test://static/resource/1 npx -y @modelcontextprotocol/server-everything -f json | jq ".contents[0].text"

Call a Prompt

mcp get-prompt simple_prompt npx -y @modelcontextprotocol/server-everything -f json | jq ".messages[0].content.text"

Viewing Server Logs

When using client commands that make calls to the server, you can add the --server-logs flag to see the server logs related to your request:

# View server logs when listing tools
mcp tools --server-logs npx -y @modelcontextprotocol/server-filesystem ~

Output:

[>] Secure MCP Filesystem Server running on stdio
[>] Allowed directories: [ '/Users/fka/' ]
read_file(path:str)
     Read the complete contents of a file from the file system.
read_multiple_files(paths:str[])
     Read the contents of multiple files simultaneously.
... and the other tools available on this server

This can be helpful for debugging or understanding what's happening on the server side when executing these commands.

Interactive Shell

The interactive shell mode allows you to run multiple MCP commands in a single session:

mcp shell npx -y @modelcontextprotocol/server-filesystem ~

This opens an interactive shell with the following capabilities:

mcp tools shell
connected to: npx -y @modelcontextprotocol/server-filesystem /Users/fka

mcp > Type '/h' for help or '/q' to quit
mcp > tools
read_file(path:str, [limit:int], [offset:int])
     Reads a file from the filesystem

list_dir(path:str)
     Lists directory contents

grep_search(pattern:str, [excludePatterns:str[]])
     Search files with pattern

edit_file(edits:{newText:str,oldText:str}[], path:str)
     Edit a file with multiple text replacements

# Direct tool calling is supported
mcp > read_file {"path":"README.md"}
...content of README.md...

# Calling a tool with complex object parameters
mcp > edit_file {"path":"main.go","edits":[{"oldText":"foo","newText":"bar"}]}
...result of edit operation...

# Get help
mcp > /h
MCP Shell Commands:
  tools                      List available tools
  resources                  List available resources
  prompts                    List available prompts
  call <entity> [--params '{...}']  Call a tool, resource, or prompt
  format [json|pretty|table] Get or set output format
Special Commands:
  /h, /help                  Show this help
  /q, /quit, exit            Exit the shell

Web Interface

MCP Tools provides a web interface for interacting with MCP servers through a browser-based UI:

# Start a web interface for a filesystem server on default port (41999)
mcp web npx -y @modelcontextprotocol/server-filesystem ~

# Use a custom port
mcp web --port 8080 docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

# Use SSE
mcp web https://ne.tools

The web interface includes:

  • A sidebar listing all available tools, resources, and prompts
  • Form-based and JSON-based parameter editing
  • Formatted and raw JSON response views
  • Interactive parameter forms automatically generated from tool schemas
  • Support for complex parameter types (arrays, objects, nested structures)
  • Direct API access for tool calling

Once started, you can access the interface by opening http://localhost:41999 (or your custom port) in a browser.

MCP Web Interface

Project Scaffolding

MCP Tools provides a scaffolding feature to quickly create new MCP servers with TypeScript:

mkdir my-mcp-server
cd my-mcp-server

# Create a project with specific components
mcp new tool:calculate resource:file prompt:greet

# Create a project with a specific SDK (currently only TypeScript/ts supported)
mcp new tool:calculate --sdk=ts

# Create a project with a specific transport type
mcp new tool:calculate --transport=stdio
mcp new tool:calculate --transport=sse

The scaffolding creates a complete project structure with:

  • Server setup with chosen transport (stdio or SSE)
  • TypeScript configuration with modern ES modules
  • Component implementations with proper MCP interfaces
  • Automatic wiring of imports and initialization

After scaffolding, you can build and run your MCP server:

# Install dependencies
npm install

# Build the TypeScript code
npm run build

# Test the server with MCP Tools
mcp tools node build/index.js

Project templates are stored in either: - Local ./templates/ directory - User's home directory: ~/.mcpt/templates/ - Homebrew installation path (/opt/homebrew/Cellar/mcp/v#.#.#/templates)

When installing via Homebrew, templates are automatically installed to your home directory. But if you use source install, you need to run make install-templates.

Server Aliases

MCP Tools allows you to save and reuse server commands with friendly aliases:

# Add a new server alias
mcp alias add myfs npx -y @modelcontextprotocol/server-filesystem ~/

# List all registered server aliases
mcp alias list

# Remove a server alias
mcp alias remove myfs

# Use an alias with any MCP command
mcp tools myfs
mcp call read_file --params '{"path":"README.md"}' myfs

Server aliases are stored in $HOME/.mcpt/aliases.json and provide a convenient way to work with commonly used MCP servers without typing long commands repeatedly.

LLM Apps Config Management

MCP Tools provides a powerful configuration management system that helps you work with MCP server configurations across multiple applications:

🚧 This works only on macOS for now.

```bash

Scan for MCP server configurations across all supported applications

mcp configs scan

List all configurations (alias for configs view --all)

mcp configs ls

View specific configuration by alias

mcp configs view vscode

Add or update a server in a configuration

mcp configs set vscode my-server npm run mcp-server mcp configs set cursor my-api https://api.example.com/mcp --headers "Autho

Core symbols most depended-on inside this repo

log
called by 19
pkg/guard/guard_proxy.go
log
called by 12
pkg/proxy/proxy.go
ConvertJSONToMap
called by 12
cmd/mcptools/commands/utils.go
assertContains
called by 12
cmd/mcptools/commands/test_helpers.go
log
called by 11
pkg/mock/mock.go
FormatAndPrintResponse
called by 11
cmd/mcptools/commands/utils.go
setupMockClient
called by 9
cmd/mcptools/commands/test_helpers.go
Load
called by 8
pkg/alias/alias.go

Shape

Function 141
Method 47
Struct 17
TypeAlias 2

Languages

Go100%

Modules by API surface

pkg/mock/mock.go23 symbols
cmd/mcptools/commands/configs.go22 symbols
pkg/jsonutils/jsonutils.go21 symbols
pkg/proxy/proxy.go18 symbols
pkg/guard/guard_proxy.go13 symbols
pkg/jsonutils/jsonutils_test.go10 symbols
cmd/mcptools/main_test.go10 symbols
cmd/mcptools/commands/test_helpers.go9 symbols
cmd/mcptools/commands/web.go7 symbols
cmd/mcptools/commands/utils.go7 symbols
pkg/alias/alias.go6 symbols
cmd/mcptools/commands/shell.go6 symbols

For agents

$ claude mcp add mcptools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact