# gemini-cli: Terminal AI Agent with MCP Server Tooling

> gemini-cli brings Gemini's AI capabilities directly to your terminal, enabling code understanding, generation, and operational automation. It integrates with MCP servers to extend its functionality with custom tools, solving complex development and automation challenges.

**Published:** 2026-07-31T12:00:14.383+00:00

**Keywords:** gemini-cli,mcp-client,ai-agent,typescript

# gemini-cli: Terminal AI Agent with MCP Server Tooling

The `gemini-cli` project delivers Gemini's AI capabilities directly into your terminal, serving as an open-source AI agent for developers. Written in TypeScript, it enables querying and editing large codebases, generating new applications from multimodal inputs like PDFs or sketches, and debugging issues using natural language.

## Extending Capabilities with MCP Servers

A core strength of `gemini-cli` lies in its integration with Model Context Protocol (MCP) servers. This allows developers to extend the CLI's functionality with custom tools, effectively turning external services into callable agents within your terminal sessions.

You configure these MCP servers in your `~/.gemini/settings.json` file. Once configured, you can invoke these custom tools directly in your `gemini-cli` prompts using an `@` prefix, followed by the server alias and the command. For example, you can:

```text
> @github List my open pull requests
> @slack Send a summary of today's commits to #dev channel
> @database Run a query to find inactive users
```

This integration enables `gemini-cli` to automate operational tasks, such as querying pull requests or handling complex rebases, by leveraging the specific capabilities exposed by your connected MCP servers. It also supports advanced integrations like media generation with Imagen, Veo, or Lyria via specialized MCP servers.

## Key Features for Developers

Beyond its MCP integration, `gemini-cli` offers a suite of features designed to streamline development workflows:

*   **Code Understanding & Generation:** Interact with large codebases, generate new applications from diverse inputs, and troubleshoot with natural language queries.
*   **Automation & Integration:** Automate tasks and connect new capabilities via MCP servers, including media generation. It can also run non-interactively in scripts for workflow automation.
*   **Advanced Capabilities:** Ground queries with built-in Google Search for real-time information, save and resume complex sessions with conversation checkpointing, and tailor behavior for projects using custom context files (GEMINI.md).
*   **Core Utility:** Access a comprehensive commands reference, create custom reusable commands, provide persistent context via `GEMINI.md` files, and optimize token usage with token caching.

The ability to integrate custom tools via MCP servers makes `gemini-cli` a flexible terminal agent for developers looking to bring AI assistance directly into their daily command-line operations.

## References

*   [gemini-cli on GitHub](https://github.com/google-gemini/gemini-cli)
*   [Model Context Protocol Documentation](https://modelcontextprotocol.io/introduction)
*   [gemini-cli on model-context-protocol.com](https://model-context-protocol.com/clients/)

## Related Repository

- [gemini-cli](https://model-context-protocol.com/clients/gemini-cli)

**Source:** https://model-context-protocol.com/blog/gemini-cli-terminal-ai-agent-with-mcp-server-tooling-mcp-client-guide
