-
Notifications
You must be signed in to change notification settings - Fork 1
feat(mcp): Add MCP server routes & dedicated customization #232
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?
Conversation
11 new issues
|
| 'availableCollections' => 'read' | ||
| }.freeze | ||
|
|
||
| def self.create(forest_server_url, auth_info, action, extra = {}) |
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.
packages/forest_admin_agent/lib/forest_admin_agent/mcp/oauth_provider.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/oauth_provider.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/schema_fetcher.rb
Show resolved
Hide resolved
| JWT.encode(payload, @auth_secret, 'HS256') | ||
| end | ||
|
|
||
| def build_refresh_token(client, user, rendering_id, forest_refresh_token, decoded) |
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.
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/mcp_endpoint.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb
Show resolved
Hide resolved
|
|
||
| private | ||
|
|
||
| def error_redirect(redirect_uri, error, error_description, state) |
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.
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_token.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/schema_fetcher.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/mcp_endpoint.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_token.rb
Show resolved
Hide resolved
Code reviewFound 2 issues:
agent-ruby/packages/forest_admin_agent/lib/forest_admin_agent/mcp/oauth_provider.rb Lines 1 to 4 in 4175a99
Fix: Add
agent-ruby/packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb Lines 33 to 35 in 4175a99
Fix: Before using 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
packages/forest_admin_agent/lib/forest_admin_agent/mcp/schema_fetcher.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/mcp_endpoint.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_token.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/oauth_provider.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/oauth_provider.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/mcp/schema_fetcher.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/mcp_endpoint.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_token.rb
Show resolved
Hide resolved
| uri.to_s | ||
| end | ||
|
|
||
| def exchange_authorization_code(client, authorization_code, code_verifier, redirect_uri) |
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.
|
|
||
| private | ||
|
|
||
| def authorization_code_payload(client, code, verifier, redirect_uri) |
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.
packages/forest_admin_agent/lib/forest_admin_agent/mcp/schema_fetcher.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/mcp_endpoint.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_authorize.rb
Show resolved
Hide resolved
packages/forest_admin_agent/lib/forest_admin_agent/routes/mcp/oauth_token.rb
Show resolved
Hide resolved
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Files with Diff Coverage (12) 🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
| fetched_at: now | ||
| } | ||
|
|
||
| { collections: collections } |
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.
| rescue UnauthorizedError => e | ||
| jsonrpc_error_response(-32_603, e.message, 401) | ||
| rescue ForbiddenError => e | ||
| jsonrpc_error_response(-32_603, e.message, 403) |
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.
| rescue StandardError => e | ||
| raise unless redirect_uri | ||
|
|
||
| error_redirect(redirect_uri, 'server_error', e.message, state) |
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.
| error_description: e.message | ||
| }, | ||
| status: 400 | ||
| } |
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.
Definition of Done
General
Security