How to call mcp server in claude code?
Add the server
Claude Code reads MCP servers from its configuration, and you can register one from the terminal with the claude mcp add command. Give the server a name, then the command or URL it uses.
Choose a scope if the command offers one, such as a project scope or a user scope.
- Run claude mcp add with a server name
- Pass the start command or the server URL
- Add any required environment variables or keys
- Confirm the server appears in the list
Let Claude use the tools
When a server is connected, its tools become available during your session. You describe the outcome you want, such as looking up records or reading a file, and Claude decides which tool to call and what arguments to send.
Tool calls appear in the session output, and your permission settings control whether you approve each one.
Check that it is connected
If a tool does not show up, check the server list and the status shown in the session. Confirm that the command path is correct and that any API key is available to the process.
Restarting the session often picks up a newly added server.
Common mistakes
- Trying to type a tool call as a shell command instead of asking for it in a prompt.
- Adding a server with a wrong command path and never checking the server list.
- Forgetting that the server may need its own API key in its environment.
