-
Notifications
You must be signed in to change notification settings - Fork 146
DRAFT - initial stab at MCP support #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"mcpServers": { | ||
"memory": { | ||
"command": "npx", | ||
"args": [ | ||
"-y", | ||
"@modelcontextprotocol/server-memory" | ||
] | ||
}, | ||
"fetch": { | ||
"command": "uvx", | ||
"args": [ | ||
"mcp-server-fetch" | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -118,3 +118,76 @@ mods --delete='naturals' --delete='a2e2' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Keep in mind that these operations are not reversible. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can repeat the delete flag to delete multiple conversations at once. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Using MCP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mods can be optionally be used as an MCP client. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Using an MCP servers.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can configure MCP servers in the settings file, or on the command line by passing a `--mcp-servers-from` flag. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mods --mcp-servers-from=~/.config/mcp/servers.json --list-mcp-servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Or in your config file: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mcp-servers-from: ~/.config/mcp/servers.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Specifying MCP servers in the mods settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+135
to
+141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth describing the expected file schema or show an example file somewhere in this section, because it's not described anywhere yet, right?
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In the config file, you can specify the path to the MCP servers file, or a list of servers to use. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use `mods --settings` to edit the settings file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mcp-servers: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sqlite: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
command: "uvx" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
args: ["mcp-server-sqlite", "--db-path", "/Users/YOUR_USERNAME/test.db"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fetch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
command: "uvx" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
args: ["mcp-server-fetch"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Listing MCP servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can list the MCP servers you have configured by running: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mods --list-mcp-servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Default MCP servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
By default, configured MCP servers will not be exposed to models. You can specify default MCP servers to always enable the settings file. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```yaml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
default-mcp-servers: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- sqlite | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Enabling MCP severs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
to enable MCP servers on the command line, you can use the `--mcp-servers`, `-T` flag. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mods --mcp-servers=fetch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Listing MCP tools | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can list the MCP tools you have configured by running: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mods --list-mcp-tools | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you remove these extra lines to the end? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,8 @@ | ||||||||||
module github.com/charmbracelet/mods | ||||||||||
|
||||||||||
go 1.21 | ||||||||||
go 1.23 | ||||||||||
|
||||||||||
toolchain go1.24.0 | ||||||||||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the latest toolchain required? If not, I think this can stay at whichever Go version is minimally required by the dependencies.
Suggested change
|
||||||||||
|
||||||||||
require ( | ||||||||||
github.com/adrg/xdg v0.5.3 | ||||||||||
|
@@ -20,6 +22,7 @@ require ( | |||||||||
github.com/cohere-ai/cohere-go/v2 v2.12.4 | ||||||||||
github.com/jmoiron/sqlx v1.4.0 | ||||||||||
github.com/lucasb-eyer/go-colorful v1.2.0 | ||||||||||
github.com/mark3labs/mcp-go v0.11.2 | ||||||||||
github.com/mattn/go-isatty v0.0.20 | ||||||||||
github.com/muesli/mango-cobra v1.2.0 | ||||||||||
github.com/muesli/roff v0.1.0 | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove this extra line, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure - in the future, is there a formatter/checker that can detect these sorts of style things for me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's https://github.com/DavidAnson/markdownlint, and if you use VS Code you can use their extension and it renders a yellow wiggle underline that you can either hover over or list in the "problems" view, or cycle through problems with F8, like this:
