mcpeasy 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.claudeignore +0 -3
  3. data/.mcp.json +19 -1
  4. data/CHANGELOG.md +59 -0
  5. data/CLAUDE.md +19 -5
  6. data/README.md +19 -3
  7. data/lib/mcpeasy/cli.rb +62 -10
  8. data/lib/mcpeasy/config.rb +22 -1
  9. data/lib/mcpeasy/setup.rb +1 -0
  10. data/lib/mcpeasy/version.rb +1 -1
  11. data/lib/utilities/gcal/README.md +11 -3
  12. data/lib/utilities/gcal/cli.rb +110 -108
  13. data/lib/utilities/gcal/mcp.rb +463 -308
  14. data/lib/utilities/gcal/service.rb +312 -0
  15. data/lib/utilities/gdrive/README.md +3 -3
  16. data/lib/utilities/gdrive/cli.rb +98 -96
  17. data/lib/utilities/gdrive/mcp.rb +290 -288
  18. data/lib/utilities/gdrive/service.rb +293 -0
  19. data/lib/utilities/gmail/README.md +278 -0
  20. data/lib/utilities/gmail/cli.rb +264 -0
  21. data/lib/utilities/gmail/mcp.rb +846 -0
  22. data/lib/utilities/gmail/service.rb +547 -0
  23. data/lib/utilities/gmeet/cli.rb +131 -129
  24. data/lib/utilities/gmeet/mcp.rb +374 -372
  25. data/lib/utilities/gmeet/service.rb +411 -0
  26. data/lib/utilities/notion/README.md +287 -0
  27. data/lib/utilities/notion/cli.rb +245 -0
  28. data/lib/utilities/notion/mcp.rb +607 -0
  29. data/lib/utilities/notion/service.rb +327 -0
  30. data/lib/utilities/slack/README.md +3 -3
  31. data/lib/utilities/slack/cli.rb +69 -54
  32. data/lib/utilities/slack/mcp.rb +277 -226
  33. data/lib/utilities/slack/service.rb +134 -0
  34. data/mcpeasy.gemspec +6 -1
  35. metadata +87 -10
  36. data/env.template +0 -11
  37. data/lib/utilities/gcal/gcal_tool.rb +0 -308
  38. data/lib/utilities/gdrive/gdrive_tool.rb +0 -291
  39. data/lib/utilities/gmeet/gmeet_tool.rb +0 -407
  40. data/lib/utilities/slack/slack_tool.rb +0 -119
  41. data/logs/.keep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a8fd6efbce3698cb6ab7c807ee5b496f6f150108779991c4b2dac8d28822a64
4
- data.tar.gz: 98e8f1895a741151767ca65243f3d83adc3feb37342624c35834bf2d0e4beeb4
3
+ metadata.gz: 96510ec1696160a8727b73d66eb7fbe9e9ac267bcdbe7c2e3db1f3a7840657f2
4
+ data.tar.gz: 64d8e8b25d58845501acba165271cc31010efbff4d3b65799ed932ab244aee09
5
5
  SHA512:
6
- metadata.gz: '07081dab8205a10e379933b40f9f618e7cb0ff05781f77b4ee7700c4a64b67f309346510d7677b813c09498a5172622ec8290294b4ffecdef5f6143a4777cac6'
7
- data.tar.gz: 14e812027277e6035e6ab21cfb0730b35e1084c03b17ea2ca905a3654923da14fa2a8c183295904f913262a9a24e56078019384344387da7735523d8de148eb3
6
+ metadata.gz: 6558ab4692baf95e5144db4f888bf594e28f8031a564d5d1127d90197c509b422225ae00438b61e640b1adc1ac355a444f1361db60485586441004d26b379b54
7
+ data.tar.gz: 8a12fc568bd98fd4ca14ea21f8e8ae6a13ae39bf34eb877a0e1b5e4e69c581f491578710147040a84550c7c4e5e4d791695208b25951ae492d877e860fc71a4f
data/.claudeignore CHANGED
@@ -1,4 +1 @@
1
1
  .env
2
- client_secret_*.apps.googleusercontent.com.json
3
- google_credentials.json
4
- .google-token.json
data/.mcp.json CHANGED
@@ -27,6 +27,15 @@
27
27
  ],
28
28
  "env": {}
29
29
  },
30
+ "gmail": {
31
+ "type": "stdio",
32
+ "command": "./bin/mcpz",
33
+ "args": [
34
+ "gmail",
35
+ "mcp"
36
+ ],
37
+ "env": {}
38
+ },
30
39
  "gmeet": {
31
40
  "type": "stdio",
32
41
  "command": "./bin/mcpz",
@@ -35,6 +44,15 @@
35
44
  "mcp"
36
45
  ],
37
46
  "env": {}
47
+ },
48
+ "notion": {
49
+ "type": "stdio",
50
+ "command": "./bin/mcpz",
51
+ "args": [
52
+ "notion",
53
+ "mcp"
54
+ ],
55
+ "env": {}
38
56
  }
39
57
  }
40
- }
58
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,59 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.0] - 2025-06-07
9
+
10
+ ### Added
11
+ - Gmail MCP server integration with comprehensive email support
12
+ - List and search emails with various filters
13
+ - Read email content including headers and body
14
+ - Send new emails and reply to existing ones
15
+ - Manage email labels, mark as read/unread
16
+ - Archive and trash emails
17
+ - Full OAuth2 authentication flow integration
18
+
19
+ ## [0.2.0] - 2025-06-03
20
+
21
+ ### Added
22
+ - Notion MCP server integration with comprehensive API support
23
+ - Pagination support for Slack channels listing
24
+ - Pagination support for Notion user listings and database queries
25
+ - Google Meet MCP server with meeting search and URL retrieval
26
+ - Setup command (`mcpz setup`) for initializing configuration directories
27
+ - Post-install message in gemspec for better user onboarding
28
+ - Shared authentication server for Google services OAuth flow
29
+ - MCP server mode for all services (Slack, Google Calendar, Drive, Meet, Notion)
30
+ - CLI interface with `mcpz` command for all services
31
+ - Configuration management system storing credentials in `~/.config/mcpeasy/`
32
+ - Logging system with logs stored in `~/.local/share/mcpeasy/logs/`
33
+
34
+ ### Changed
35
+ - Refactored project structure for better consistency and namespacing
36
+ - Converted project from standalone scripts to Ruby gem
37
+ - Moved from individual MCP servers to unified gem architecture
38
+ - Refactored Google services to share authentication token capture server
39
+ - Improved MCP server implementation with fresh tool instances per call
40
+ - Standardized service structure with consistent cli.rb, mcp.rb, service.rb pattern
41
+
42
+ ### Fixed
43
+ - Emoji rendering in Google token capture service
44
+ - Ruby code style compliance with standardrb
45
+
46
+ ### Removed
47
+ - Unused project files and dependencies
48
+ - Git submodules for external MCP servers
49
+ - Direct dependency on ruby-sdk in favor of hand-rolled implementation
50
+
51
+ ## [0.1.0] - Initial Release
52
+
53
+ ### Added
54
+ - Initial gem structure with Thor-based CLI
55
+ - Slack integration with message posting and channel listing
56
+ - Google Calendar integration with event listing and search
57
+ - Google Drive integration with file search and content retrieval
58
+ - Basic MCP server implementations for all services
59
+ - Development tooling with standardrb for code quality
data/CLAUDE.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
4
 
5
+ ## Important Reminders
6
+
7
+ **Date/Time Accuracy**: The environment context date provided at startup may be incorrect. Always verify the current date and time using the `date` command when needed. Also watch out for time/date terms which are relative to today's date, e.g. "tomorrow", "this week" or "the next 48 hours".
8
+
5
9
  ## Project Overview
6
10
 
7
11
  **MCPEasy** is a Ruby gem that provides multiple Model Context Protocol (MCP) servers for integrating with AI assistants like Claude Code. The gem includes MCP servers for:
@@ -67,6 +71,16 @@ Run linting:
67
71
  bundle exec standardrb
68
72
  ```
69
73
 
74
+ Searching within project files:
75
+ ```bash
76
+ git grep "search pattern example"
77
+ ```
78
+
79
+ Move or rename files:
80
+ ```bash
81
+ git mv old_file_name new_file_name
82
+ ```
83
+
70
84
  Build gem:
71
85
  ```bash
72
86
  gem build mcpeasy.gemspec
@@ -139,21 +153,21 @@ Each service directory follows a consistent structure with four key components:
139
153
  - Extends Thor for command-line interface functionality
140
154
  - Provides user-friendly CLI commands for the service
141
155
  - Handles argument parsing and validation
142
- - Calls into the `*_tool.rb` for actual service operations
156
+ - Calls into the `service.rb` for actual service operations
143
157
  - Example: `mcpz slack post` command implementation
144
158
 
145
159
  ##### `mcp.rb` - MCP Server Implementation
146
160
  - Implements the Model Context Protocol JSON-RPC server
147
161
  - Handles MCP initialization, tool registration, and request processing
148
- - Translates MCP tool calls into `*_tool.rb` method calls
162
+ - Translates MCP tool calls into `service.rb` method calls
149
163
  - Provides structured responses back to AI assistants
150
164
  - Runs as a persistent server process when called with `mcpz [service] mcp`
151
165
 
152
- ##### `*_tool.rb` - Core Service Functionality
166
+ ##### `service.rb` - Core Service Functionality
153
167
  - Contains the main business logic for interacting with external APIs
154
168
  - Handles authentication, API calls, error handling, and response formatting
155
169
  - Shared between both CLI and MCP modes for consistency
156
- - Service-specific naming: `slack_tool.rb`, `gcal_tool.rb`, `gdrive_tool.rb`, `gmeet_tool.rb`
170
+ - Each service has its own `service.rb` file within its directory
157
171
  - Designed to be framework-agnostic and reusable
158
172
 
159
173
  ##### `README.md` - Service-specific Documentation
@@ -167,4 +181,4 @@ Each service directory follows a consistent structure with four key components:
167
181
  All services follow the same pattern:
168
182
  1. **CLI mode**: Direct command-line usage via `mcpz [service] [command]`
169
183
  2. **MCP mode**: JSON-RPC server mode via `mcpz [service] mcp`
170
- 3. **Authentication**: Service-specific auth handling with shared config storage
184
+ 3. **Authentication**: Service-specific auth handling with shared config storage
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # MCPEasy
1
+ # MCPeasy
2
2
 
3
3
  A Ruby gem that provides multiple Model Context Protocol (MCP) servers for integrating with AI assistants like Claude Code. Each MCP server provides programmatic access to popular web services and APIs.
4
4
 
@@ -36,6 +36,11 @@ Find and manage Google Meet meetings from your calendar.
36
36
  - CLI: List meetings, search by content, get meeting URLs
37
37
  - MCP: AI assistant access to upcoming meetings and direct links
38
38
 
39
+ ### 📝 [Notion](./lib/utilities/notion/)
40
+ Search pages and databases in your Notion workspace.
41
+ - CLI: Search pages/databases, retrieve content, query database entries
42
+ - MCP: AI assistant access to Notion workspace content and organization
43
+
39
44
  ## Quick Start
40
45
 
41
46
  ### 1. Configuration Setup
@@ -54,6 +59,9 @@ mcpz slack set_bot_token xoxb-your-slack-token
54
59
 
55
60
  # For Google services (Calendar, Drive, Meet)
56
61
  mcpz google auth
62
+
63
+ # For Notion
64
+ mcpz notion set_api_key secret_your-notion-integration-token
57
65
  ```
58
66
 
59
67
  Credentials are stored securely in `~/.config/mcpeasy/` (see individual server documentation for specific setup requirements).
@@ -74,6 +82,9 @@ mcpz gdrive search "quarterly report"
74
82
 
75
83
  # Google Meet
76
84
  mcpz gmeet upcoming
85
+
86
+ # Notion
87
+ mcpz notion search_pages "meeting notes"
77
88
  ```
78
89
 
79
90
  ### 3. MCP Server Configuration
@@ -98,6 +109,10 @@ For use with Claude Code, add servers to your `.mcp.json`:
98
109
  "gmeet": {
99
110
  "command": "mcpz",
100
111
  "args": ["gmeet", "mcp"]
112
+ },
113
+ "notion": {
114
+ "command": "mcpz",
115
+ "args": ["notion", "mcp"]
101
116
  }
102
117
  }
103
118
  }
@@ -141,7 +156,8 @@ lib/
141
156
  ├── slack/ # Slack integration
142
157
  ├── gcal/ # Google Calendar
143
158
  ├── gdrive/ # Google Drive
144
- └── gmeet/ # Google Meet
159
+ ├── gmeet/ # Google Meet
160
+ └── notion/ # Notion integration
145
161
  ```
146
162
 
147
163
  ### Contributing
@@ -158,4 +174,4 @@ This project is licensed under the MIT License.
158
174
 
159
175
  ## Support
160
176
 
161
- For issues, questions, or contributions, please visit the project repository.
177
+ For issues, questions, or contributions, please visit the project repository.
data/lib/mcpeasy/cli.rb CHANGED
@@ -7,8 +7,8 @@ module Mcpeasy
7
7
  class GoogleCommands < Thor
8
8
  desc "auth", "Authenticate with Google services (Calendar, Drive, Meet)"
9
9
  def auth
10
- require_relative "../utilities/gcal/gcal_tool"
11
- tool = GcalTool.new(skip_auth: true)
10
+ require_relative "../utilities/gcal/service"
11
+ tool = Gcal::Service.new(skip_auth: true)
12
12
  result = tool.authenticate
13
13
  if result[:success]
14
14
  puts "✅ Successfully authenticated with Google services"
@@ -23,52 +23,52 @@ module Mcpeasy
23
23
  # Load the existing GcalCLI and extend it with MCP functionality
24
24
  require_relative "../utilities/gcal/cli"
25
25
 
26
- class GcalCommands < GcalCLI
26
+ class GcalCommands < Gcal::CLI
27
27
  namespace "gcal"
28
28
 
29
29
  desc "mcp", "Run Google Calendar MCP server"
30
30
  def mcp
31
31
  require_relative "../utilities/gcal/mcp"
32
- MCPServer.new.run
32
+ Gcal::MCPServer.new.run
33
33
  end
34
34
  end
35
35
 
36
36
  # Load the existing GdriveCLI and extend it with MCP functionality
37
37
  require_relative "../utilities/gdrive/cli"
38
38
 
39
- class GdriveCommands < GdriveCLI
39
+ class GdriveCommands < Gdrive::CLI
40
40
  namespace "gdrive"
41
41
 
42
42
  desc "mcp", "Run Google Drive MCP server"
43
43
  def mcp
44
44
  require_relative "../utilities/gdrive/mcp"
45
- MCPServer.new.run
45
+ Gdrive::MCPServer.new.run
46
46
  end
47
47
  end
48
48
 
49
49
  # Load the existing GmeetCLI and extend it with MCP functionality
50
50
  require_relative "../utilities/gmeet/cli"
51
51
 
52
- class GmeetCommands < GmeetCLI
52
+ class GmeetCommands < Gmeet::CLI
53
53
  namespace "gmeet"
54
54
 
55
55
  desc "mcp", "Run Google Meet MCP server"
56
56
  def mcp
57
57
  require_relative "../utilities/gmeet/mcp"
58
- MCPServer.new.run
58
+ Gmeet::MCPServer.new.run
59
59
  end
60
60
  end
61
61
 
62
62
  # Load the existing SlackCLI and extend it with MCP functionality
63
63
  require_relative "../utilities/slack/cli"
64
64
 
65
- class SlackCommands < SlackCLI
65
+ class SlackCommands < Slack::CLI
66
66
  namespace "slack"
67
67
 
68
68
  desc "mcp", "Run Slack MCP server"
69
69
  def mcp
70
70
  require_relative "../utilities/slack/mcp"
71
- MCPServer.new.run
71
+ Slack::MCPServer.new.run
72
72
  end
73
73
 
74
74
  desc "set_bot_token TOKEN", "Set Slack bot token"
@@ -84,6 +84,51 @@ module Mcpeasy
84
84
  end
85
85
  end
86
86
 
87
+ # Load the existing NotionCLI and extend it with MCP functionality
88
+ require_relative "../utilities/notion/cli"
89
+
90
+ class NotionCommands < Notion::CLI
91
+ namespace "notion"
92
+
93
+ desc "mcp", "Run Notion MCP server"
94
+ def mcp
95
+ require_relative "../utilities/notion/mcp"
96
+ Notion::MCPServer.new.run
97
+ end
98
+
99
+ desc "set_api_key API_KEY", "Set Notion API key"
100
+ def set_api_key(api_key)
101
+ Config.save_notion_api_key(api_key)
102
+ puts "✅ Notion API key saved successfully"
103
+ end
104
+ end
105
+
106
+ # Load the existing GmailCLI and extend it with MCP functionality
107
+ require_relative "../utilities/gmail/cli"
108
+
109
+ class GmailCommands < Gmail::CLI
110
+ namespace "gmail"
111
+
112
+ desc "mcp", "Run Gmail MCP server"
113
+ def mcp
114
+ require_relative "../utilities/gmail/mcp"
115
+ Gmail::MCPServer.new.run
116
+ end
117
+
118
+ desc "auth", "Authenticate with Gmail API"
119
+ def auth
120
+ require_relative "../utilities/gmail/service"
121
+ tool = Gmail::Service.new(skip_auth: true)
122
+ result = tool.authenticate
123
+ if result[:success]
124
+ puts "✅ Successfully authenticated with Gmail"
125
+ else
126
+ puts "❌ Authentication failed: #{result[:error]}"
127
+ exit 1
128
+ end
129
+ end
130
+ end
131
+
87
132
  class CLI < Thor
88
133
  desc "version", "Show mcpeasy version"
89
134
  def version
@@ -105,6 +150,7 @@ module Mcpeasy
105
150
  puts "🔑 Google credentials: #{status[:google_credentials] ? "✅" : "❌"}"
106
151
  puts "🎫 Google token: #{status[:google_token] ? "✅" : "❌"}"
107
152
  puts "💬 Slack config: #{status[:slack_config] ? "✅" : "❌"}"
153
+ puts "📝 Notion config: #{status[:notion_config] ? "✅" : "❌"}"
108
154
  end
109
155
 
110
156
  desc "set_google_credentials PATH", "Save Google credentials from downloaded JSON file"
@@ -143,6 +189,12 @@ module Mcpeasy
143
189
  desc "slack COMMAND", "Slack commands"
144
190
  subcommand "slack", SlackCommands
145
191
 
192
+ desc "notion COMMAND", "Notion commands"
193
+ subcommand "notion", NotionCommands
194
+
195
+ desc "gmail COMMAND", "Gmail commands"
196
+ subcommand "gmail", GmailCommands
197
+
146
198
  class << self
147
199
  private
148
200
 
@@ -9,6 +9,7 @@ module Mcpeasy
9
9
  CONFIG_DIR = File.expand_path("~/.config/mcpeasy").freeze
10
10
  GOOGLE_DIR = File.join(CONFIG_DIR, "google").freeze
11
11
  SLACK_DIR = File.join(CONFIG_DIR, "slack").freeze
12
+ NOTION_DIR = File.join(CONFIG_DIR, "notion").freeze
12
13
  LOGS_DIR = File.expand_path("~/.local/share/mcpeasy/logs").freeze
13
14
 
14
15
  class << self
@@ -16,6 +17,7 @@ module Mcpeasy
16
17
  FileUtils.mkdir_p(CONFIG_DIR)
17
18
  FileUtils.mkdir_p(GOOGLE_DIR)
18
19
  FileUtils.mkdir_p(SLACK_DIR)
20
+ FileUtils.mkdir_p(NOTION_DIR)
19
21
  FileUtils.mkdir_p(LOGS_DIR)
20
22
  end
21
23
 
@@ -79,6 +81,24 @@ module Mcpeasy
79
81
  File.write(slack_token_path, JSON.pretty_generate(config))
80
82
  end
81
83
 
84
+ # Notion configuration
85
+ def notion_token_path
86
+ File.join(NOTION_DIR, "token.json")
87
+ end
88
+
89
+ def notion_api_key
90
+ return nil unless File.exist?(notion_token_path)
91
+ config = JSON.parse(File.read(notion_token_path))
92
+ config["api_key"]
93
+ end
94
+
95
+ def save_notion_api_key(api_key)
96
+ ensure_config_dirs
97
+ config = File.exist?(notion_token_path) ? JSON.parse(File.read(notion_token_path)) : {}
98
+ config["api_key"] = api_key
99
+ File.write(notion_token_path, JSON.pretty_generate(config))
100
+ end
101
+
82
102
  # Logs directory
83
103
  def logs_dir
84
104
  LOGS_DIR
@@ -94,7 +114,8 @@ module Mcpeasy
94
114
  logs_dir: LOGS_DIR,
95
115
  google_credentials: File.exist?(google_credentials_path),
96
116
  google_token: File.exist?(google_token_path),
97
- slack_config: File.exist?(slack_token_path)
117
+ slack_config: File.exist?(slack_token_path),
118
+ notion_config: File.exist?(notion_token_path)
98
119
  }
99
120
  end
100
121
  end
data/lib/mcpeasy/setup.rb CHANGED
@@ -14,6 +14,7 @@ module Mcpeasy
14
14
  puts "Created #{Config::CONFIG_DIR}"
15
15
  puts "Created #{Config::GOOGLE_DIR}"
16
16
  puts "Created #{Config::SLACK_DIR}"
17
+ puts "Created #{Config::NOTION_DIR}"
17
18
  puts "Created #{Config::LOGS_DIR}"
18
19
 
19
20
  puts "mcpeasy setup complete!"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mcpeasy
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -128,6 +128,14 @@ The server provides these tools to Claude Code:
128
128
  - **list_calendars**: List available calendars
129
129
  - **search_events**: Search for events by text content
130
130
 
131
+ The server also provides helpful prompts for common calendar queries:
132
+
133
+ - **check_schedule**: Check your calendar schedule for a specific time period
134
+ - **find_meeting**: Find a specific meeting or event by searching for keywords
135
+ - **check_availability**: Check if you're free at a specific time
136
+ - **weekly_overview**: Get an overview of your schedule for the upcoming week
137
+ - **meeting_conflicts**: Check for any overlapping or back-to-back meetings
138
+
131
139
  ## Security & Permissions
132
140
 
133
141
  ### Required OAuth Scopes
@@ -201,14 +209,14 @@ tail -f logs/mcp_gcal_startup.log
201
209
  utilities/gcal/
202
210
  ├── cli.rb # Thor-based CLI interface
203
211
  ├── mcp.rb # MCP server implementation
204
- ├── gcal_tool.rb # Google Calendar API wrapper
212
+ ├── service.rb # Google Calendar API wrapper
205
213
  └── README.md # This file
206
214
  ```
207
215
 
208
216
  ### Adding New Features
209
217
 
210
- 1. **New API methods**: Add to `GcalTool` class
211
- 2. **New CLI commands**: Add to `GcalCLI` class
218
+ 1. **New API methods**: Add to `Service` class
219
+ 2. **New CLI commands**: Add to `CLI` class
212
220
  3. **New MCP tools**: Add to `MCPServer` class
213
221
 
214
222
  ### Testing