Skip to content
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

(feat) add server aliases functionality #16

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

ayakut16
Copy link
Contributor

@ayakut16 ayakut16 commented Apr 1, 2025

Description

Added the ability to store and use MCP server aliases:
- New 'alias' command with add/list/remove subcommands
- Added pkg/alias package to encapsulate saving/loading logic.
- Updated README with server aliases documentation

Motivation: I often use the cli with the same set of mcp servers (stripe, server-filesystem) etc. and I need to check for the command each time, so I thought it would be nice to be able to add aliases.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

~ make build
~ ./bin/mcp alias list
No aliases registered.
~  mcptools git:(feature/server-aliases) ./bin/mcp alias add fs npx -y @modelcontextprotocol/server-filesystem ~
Alias 'fs' registered for command: npx -y @modelcontextprotocol/server-filesystem /Users/alperen
~  mcptools git:(feature/server-aliases) ./bin/mcp tools fs
read_file(path:str)
     Read the complete contents of a file from the file system. Handles various
     text encodings and provides detailed error messages if the file cannot be
     read. Use this tool when you need to examine the contents of a single
     file. Only works within allowed directories.

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ayakut16 ayakut16 marked this pull request as draft April 1, 2025 18:07
@ayakut16 ayakut16 changed the title [feat) add server aliases functionality (feat) add server aliases functionality Apr 1, 2025
@ayakut16 ayakut16 marked this pull request as ready for review April 1, 2025 19:49
@f
Copy link
Owner

f commented Apr 2, 2025

That's a great one! Thank you! @ayakut16 can you fix the lint issues and commit again?

@ayakut16
Copy link
Contributor Author

ayakut16 commented Apr 2, 2025

That's a great one! Thank you! @ayakut16 can you fix the lint issues and commit again?

Thank you ! The lint issues are irrelevant to this PR, make lint fails at HEAD for json_utils.go, json_utils_test.go main_test.go none of which is changed in this PR.

If you still want me to fix that I can give it a try.

Edit: I added an extra commit to this PR that fixes lint errors.

@f
Copy link
Owner

f commented Apr 2, 2025

That's strange. You're right, I'll fix these and merge.

@f f merged commit 7909bce into f:master Apr 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants