> ## Documentation Index
> Fetch the complete documentation index at: https://graph.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Test an MCP server

> Check that graph can reach an MCP server, list its tools, and call one directly.

Work from the connection up: confirm graph reaches the server, then that it loads the tools you expect, then that a tool returns what you expect.

## Check the connection

`graph mcp list` shows each configured server and how graph reaches it:

```text theme={null}
everything	stdio: npx -y @modelcontextprotocol/server-everything
tracker	http: https://mcp.example.com/mcp
```

`graph mcp test` connects to one server and lists its tools:

```bash theme={null}
graph mcp test everything
```

```text theme={null}
ok: 'everything' initialized in 1.37s — 13 tools (1 declare output schemas)
```

## List the tools graph loads

`graph mcp tools` shows each tool graph loads from a server, after `include_tools` and `exclude_tools`, with its description:

```bash theme={null}
graph mcp tools everything
```

```text theme={null}
everything — 2 tools
  echo [read-only]
  Returns the message it is given, prefixed with 'Echo: '.
  get-sum [read-only]
  Returns the sum of two numbers
```

To change that list, see [Filter and override a server's tools](/integrating/mcp/guides/filter-and-override-tools).

## Call a tool directly

`graph tool test` calls a tool by its full name and prints the result. Pass input as JSON, as `@file`, on stdin, or with `--input key=value`:

```bash theme={null}
graph tool test everything__get-sum '{"a": 2, "b": 3}'
```

```json theme={null}
{
  "text": "The sum of 2 and 3 is 5."
}
```

When the server rejects the call, graph prints `tool returned an error:` and the server's message:

```text theme={null}
tool returned an error:
{
  "text": "MCP error -32602: Input validation error: Invalid arguments for tool get-sum: ..."
}
```

A tool that returns an error still exits 0. Use `--json` and check `isError` in scripts.

## When it fails

* **A missing environment variable.** graph names the variable and the setting that uses it, and connects to your other servers as usual:

  ```text theme={null}
  mcp server 'tracker' cannot connect: environment variable TRACKER_TOKEN (mcp.tracker.headers.Authorization) is not set
  ```

* **Anything else.** Run with `-v`, or set `GRAPH_LOG=debug`, to see graph's log of the connection on stderr.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.