list_current_dir_files_tool

command module
v0.0.0-...-88b0500 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 10 Imported by: 0

README

List Current Directory Files Tool

This example demonstrates how MCP resource could be defined using Foxy Contexts library.

Further assumes that you have installed Golang and (only for inspector) - Node.js.

Trying with inspector

To try this example with inspector, run the following command:

npx @modelcontextprotocol/inspector go run main.go

Then in browser open http://localhost:5173 then click Connect then click List Tools then click list-current-dir-files

You should see list of files in current directory.

Trying with Claude

Firstly you would need to run in this folder:

go install

, and make sure that you have configured golang bin directory in your PATH.

Now in your Claude Desktop configuration file add the following:

{
    "mcpServers": {
        "list_current_dir_files_tool": {
            "command": "list_current_dir_files_tool",
            "args": []
        }
    }
}

Now when you run Claude Desktop, you can ask Claude to list files in current directory. It is probably not very useful, as you would see files in whatever directory Claude is running from.

Auto test

This will run integration test:

go test

Check out testcase in testdata/list_and_call_test.yaml and test runner setup in main_test.go.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳