Skip to content

Commit 9c1d82b

Browse files
authored
feat: add support for mcp (#44)
* wip * add support for mcp tools * minor tweaks to shutting down app
1 parent d99bc0f commit 9c1d82b

File tree

15 files changed

+1934
-35
lines changed

15 files changed

+1934
-35
lines changed

README.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ A conversational AI CLI tool powered by Grok with intelligent text editor capabi
1010
- **📝 Smart File Operations**: AI automatically uses tools to view, create, and edit files
1111
- **⚡ Bash Integration**: Execute shell commands through natural conversation
1212
- **🔧 Automatic Tool Selection**: AI intelligently chooses the right tools for your requests
13+
- **🔌 MCP Tools**: Extend capabilities with Model Context Protocol servers (Linear, GitHub, etc.)
1314
- **💬 Interactive UI**: Beautiful terminal interface built with Ink
1415
- **🌍 Global Installation**: Install and use anywhere with `npm i -g @vibe-kit/grok-cli`
1516

@@ -166,19 +167,63 @@ Follow the existing code style and patterns in this project.
166167

167168
Grok will automatically load and follow these instructions when working in your project directory. The custom instructions are added to Grok's system prompt and take priority over default behavior.
168169

169-
## Example Conversations
170+
## MCP Tools
170171

171-
Instead of typing commands, just tell Grok what you want to do:
172+
Grok CLI supports MCP (Model Context Protocol) servers, allowing you to extend the AI assistant with additional tools and capabilities.
172173

174+
### Adding MCP Tools
175+
176+
#### Add a custom MCP server:
177+
```bash
178+
# Add an stdio-based MCP server
179+
grok mcp add my-server --transport stdio --command "node" --args server.js
180+
181+
# Add an HTTP-based MCP server
182+
grok mcp add my-server --transport http --url "http://localhost:3000"
183+
184+
# Add with environment variables
185+
grok mcp add my-server --transport stdio --command "python" --args "-m" "my_mcp_server" --env "API_KEY=your_key"
186+
```
187+
188+
#### Add from JSON configuration:
189+
```bash
190+
grok mcp add-json my-server '{"command": "node", "args": ["server.js"], "env": {"API_KEY": "your_key"}}'
191+
```
192+
193+
### Linear Integration Example
194+
195+
To add Linear MCP tools for project management:
196+
197+
```bash
198+
# Add Linear MCP server
199+
grok mcp add linear --transport sse --url "https://mcp.linear.app/sse"
173200
```
174-
💬 "Show me the contents of package.json"
175-
💬 "Create a new file called hello.js with a simple console.log"
176-
💬 "Find all TypeScript files in the src directory"
177-
💬 "Replace 'oldFunction' with 'newFunction' in all JS files"
178-
💬 "Run the tests and show me the results"
179-
💬 "What's the current directory structure?"
201+
202+
This enables Linear tools like:
203+
- Create and manage Linear issues
204+
- Search and filter issues
205+
- Update issue status and assignees
206+
- Access team and project information
207+
208+
### Managing MCP Servers
209+
210+
```bash
211+
# List all configured servers
212+
grok mcp list
213+
214+
# Test server connection
215+
grok mcp test server-name
216+
217+
# Remove a server
218+
grok mcp remove server-name
180219
```
181220

221+
### Available Transport Types
222+
223+
- **stdio**: Run MCP server as a subprocess (most common)
224+
- **http**: Connect to HTTP-based MCP server
225+
- **sse**: Connect via Server-Sent Events
226+
182227
## Development
183228

184229
```bash

0 commit comments

Comments
 (0)