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

add enabledTools args #36

Merged
merged 6 commits into from
Apr 6, 2025
Merged

add enabledTools args #36

merged 6 commits into from
Apr 6, 2025

Conversation

SugiKent
Copy link
Contributor

@SugiKent SugiKent commented Apr 4, 2025

Key Changes:

  • Added --enabledTools parameter that accepts comma-separated tool names
  • Implemented tool filtering functionality in filterTools()
  • Added comprehensive test coverage for the new feature
  • Updated README with usage examples and documentation
  • Specifically documented read-only tools for security-conscious implementations

Benefits:

  • Allows users to run the server with only necessary tools enabled
  • Improves security by limiting exposed functionality
  • Reduces attack surface when only read-only access is needed
  • Maintains full backward compatibility (all tools enabled by default)

It is particularly important for me as a Cursor user whose number of mcp tools is limited.

Example Usage:

Run with only read-only tools

node build/index.js --enabledTools=notion_retrieve_block,notion_retrieve_page,notion_query_database

Or with specific write tools

node build/index.js --enabledTools=notion_append_block_children,notion_update_page_properties

@suekou suekou self-requested a review April 6, 2025 11:08
@suekou
Copy link
Owner

suekou commented Apr 6, 2025

@SugiKent Thank you for your contribution🚀 !! (コントリビュートありがとうございます)

@suekou suekou merged commit a579034 into suekou:main Apr 6, 2025
@agladky
Copy link

agladky commented Apr 6, 2025

Hi @suekou! 👋

It's a great update!

However, I noticed that the code uses yargs, but it’s only listed under devDependencies in package.json. As a result, it doesn’t get installed when used via config like this:

"notion": {
  "command": "npx",
  "args": ["-y", "@suekou/mcp-notion-server"],
  "env": {
    "NOTION_API_TOKEN": "key"
  }
}

Here’s the log output:

[notion] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
node:internal/modules/package_json_reader:267
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'yargs' imported from /Users/username/.npm/_npx/be62e5118b20154c/node_modules/@suekou/mcp-notion-server/build/index.js
...

Could you please move yargs to dependencies so it’s available at runtime? Thanks! 🙏

@suekou
Copy link
Owner

suekou commented Apr 6, 2025

@agladky Thanks for pointing that out! You're right — I've moved yargs to dependencies so it works properly with npx. (#41) Appreciate the heads-up 🙏
I've confirmed it's working in my environment, but could you let me know if it works on your end as well?

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.

4 participants