feat: add tool get cookie #165
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🍪 Add Cookie Retrieval Tool to MCP Chrome Server
📋 Summary
This PR adds a new
chrome_get_cookietool to the MCP Chrome Server, enabling AI assistants to retrieve cookies from specified websites through the Model Context Protocol.✨ New Feature
chrome_get_cookie🔧 Technical Changes
1. Shared Package Updates (
packages/shared/src/tools.ts)GET_COOKIE: 'chrome_get_cookie'toTOOL_NAMES.BROWSERurlparameter (string) starting with http/https2. Chrome Extension Implementation (
app/chrome-extension/entrypoints/background/tools/browser/cookie.ts)GetCookieToolclass extendingBaseBrowserToolExecutorchrome.cookies.getAll()API3. Tool Registration (
app/chrome-extension/entrypoints/background/tools/browser/index.ts)getCookieToolfrom browser tools index4. Permission Updates (
app/chrome-extension/wxt.config.ts)cookiespermission to extension manifest📊 Output Format
{ "success": true, "message": "Successfully retrieved X cookies from example.com", "url": "https://example.com", "domain": "example.com", "cookies": [ { "name": "session_id", "value": "abc123", "domain": "example.com", "path": "/", "secure": true, "httpOnly": false, "expirationDate": 1234567890, "sameSite": "Lax" } ], "cookieString": "session_id=abc123; user_pref=dark_mode" }🎯 Use Cases
🔒 Security Considerations
cookiespermission in extension manifest�� Testing
📝 Example Usage
🚀 Benefits
📋 Checklist
�� Related Issues
Ready for Review ✅
Breaking Changes: None
Testing Required: Manual testing with Chrome extension
Documentation: Updated tool schemas and examples