Commit Graph

4066 Commits

Author SHA1 Message Date
Elliot
ae40ec239d fix(git): add missing argument injection guards to git_show, git_create_branch, git_log, and git_branch (#3545)
fix(git): add missing argument injection guards

Extends existing startswith("-") input validation to git_show, git_create_branch, git_log, and git_branch, preventing user-supplied values from being interpreted as CLI flags by GitPython's subprocess calls to git.
2026-03-15 09:04:24 -07:00
Niels Kaspers
81f8301cd2 feat(time): add tool annotations to get_current_time and convert_time (#3574) (#3581)
feat(time): add tool annotations

Adds MCP ToolAnnotations to both time server tools (get_current_time, convert_time). Both are read-only, non-destructive, idempotent, and closed-world.

Fixes #3574
2026-03-15 08:51:02 -07:00
Niels Kaspers
c2ee97e792 feat(sequential-thinking): add tool annotations (#3534)
feat(sequential-thinking): add tool annotations

Adds MCP ToolAnnotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) to the sequential-thinking tool, bringing it in line with the annotation pattern established by the filesystem server.

Fixes #3403
2026-03-15 08:50:08 -07:00
Anshul Garg
83b22050b8 fix(fetch): handle malformed input without crashing (#3515)
fix(fetch): handle malformed input without crashing

Changes `raise_exceptions=True` to `raise_exceptions=False` in the fetch server's `Server.run()` call, preventing the server from crashing on malformed JSON-RPC input. This aligns with the SDK's intended default behavior and is consistent with other reference servers.

Fixes #3359
2026-03-15 08:35:30 -07:00
Ola Hungerford
a97aba19eb Merge pull request #3293 from thecaptain789/fix-httpx-proxy-arg
fix(fetch): update to httpx 0.28+ proxy parameter
2026-03-07 12:38:04 -07:00
Ola Hungerford
ad3e660cc1 Merge pull request #3252 from dotsetgreg/fix/session-resource-reregistration
fix(everything): allow re-registration of session resources
2026-03-07 12:32:28 -07:00
Ola Hungerford
6d977ddc62 Merge pull request #3297 from DukeDeSouth/fix/memory-open-nodes-relations
fix(memory): return relations connected to requested nodes in openNodes/searchNodes
2026-03-07 12:25:27 -07:00
Ola Hungerford
72efc42976 Merge pull request #3230 from nulone/fix/filesystem-move-file-destructive-hint
fix(filesystem): mark move_file as destructive operation
2026-02-28 14:17:21 -07:00
Ola Hungerford
04cce79b4c Merge pull request #3398 from modelcontextprotocol/localden/servers
Update README.md
2026-02-24 18:38:19 -07:00
Den Delimarsky
599b170e9d Update README.md 2026-02-24 17:32:52 -08:00
David Wong
0e06979028 add figma to official integrations list (#3363) 2026-02-24 17:35:23 +00:00
Ola Hungerford
a83b1451c5 Merge pull request #3254 from wingding12/fix/filesystem-macos-symlink-path-resolution
fix(filesystem): resolve symlinked allowed directories to both forms
2026-02-19 07:36:47 -07:00
Ellis Shang
1b96551ef0 fix(filesystem): use fileURLToPath for Windows absolute path parsing (#3205) 2026-02-19 05:52:11 -07:00
Ola Hungerford
6a914b9db8 Merge pull request #3350 from modelcontextprotocol/localden/sec-doc-update
Update SECURITY.md to use GitHub Security Advisories
2026-02-18 19:58:50 -07:00
Den Delimarsky
5e3735d081 Update SECURITY.md to use GitHub Security Advisories 2026-02-18 20:51:23 +00:00
Cliff Hall
618cf4867b Merge pull request #2609 from modelcontextprotocol/claude/issue-2526-20250824-0240
fix: resolve relative paths against allowed directories instead of process.cwd()
2026-02-11 09:57:53 -05:00
Koichi ITO
173d991153 Merge pull request #3320 from modelcontextprotocol/dependabot/uv/src/fetch/uv-7997262317
Bump the uv group across 3 directories with 1 update
2026-02-11 16:59:41 +09:00
dependabot[bot]
e3ea3c8b7f Bump the uv group across 3 directories with 1 update
Bumps the uv group with 1 update in the /src/fetch directory: [cryptography](https://github.com/pyca/cryptography).
Bumps the uv group with 1 update in the /src/git directory: [cryptography](https://github.com/pyca/cryptography).
Bumps the uv group with 1 update in the /src/time directory: [cryptography](https://github.com/pyca/cryptography).


Updates `cryptography` from 46.0.3 to 46.0.5
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.3...46.0.5)

Updates `cryptography` from 46.0.3 to 46.0.5
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.3...46.0.5)

Updates `cryptography` from 46.0.3 to 46.0.5
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.3...46.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: indirect
  dependency-group: uv
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: indirect
  dependency-group: uv
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 02:51:37 +00:00
Ola Hungerford
70c549be69 Merge pull request #3306 from shuklaham/time_doc_update
docs(time): add explicit uvx command to installation section
2026-02-09 09:43:46 -07:00
Shubham Shukla
26c0d57d57 docs(time): add explicit uvx command to installation section
The uv installation section mentioned using uvx but didn't show the
actual command, unlike the PIP section which shows both install and run
commands. This adds the missing `uvx mcp-server-time` command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:23:30 -08:00
olaservo
87a996b548 fix(filesystem): run npm audit fix to resolve qs vulnerability
Fixes high-severity qs DoS vulnerability (GHSA-6rw7-vpxm-498p).
Remaining moderate-severity issues are in dev dependencies
(esbuild/vite/vitest) and require a breaking vitest v2->v4 upgrade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 18:52:47 -07:00
Cliff Hall
3921f5c041 Merge branch 'main' into claude/issue-2526-20250824-0240 2026-02-07 16:57:16 -05:00
Ola Hungerford
ccf675184e Merge pull request #3236 from nielskaspers/add-everything-server-tests
Add Vitest tests for Everything Server
2026-02-07 10:14:57 -07:00
DukeDeSouth
ca7ea2253e fix(memory): return relations connected to requested nodes in openNodes/searchNodes
Previously, `openNodes` and `searchNodes` only returned relations where
BOTH endpoints were in the result set (using `&&`). This silently
dropped all relations to/from nodes outside the set — making it
impossible to discover a node's connections without calling `read_graph`
and filtering the entire dataset client-side.

Changed the filter from `&&` to `||` so that any relation with at least
one endpoint in the result set is included. This matches the expected
graph-query semantics: when you open a node, you should see all its
edges, not just edges to other opened nodes.

Fixes #3137

Tests updated and new cases added covering:
- Outgoing relations to nodes not in the open set
- Incoming relations from nodes not in the open set
- Relations connected to a single opened node
- searchNodes returning outgoing relations to unmatched entities

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 20:14:27 -05:00
Niels Kaspers
cd20aee6b4 Add experimental.tasks mock for new task-based tools
The upstream main added simulate-research-query and async tools that
use server.experimental.tasks.registerToolTask. Update mock servers
to include this API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 23:21:49 +02:00
Niels Kaspers
0ca9921e20 Trim low-value tests per review feedback
Removed ~29 tests that were adding noise rather than coverage:
- Registration boilerplate tests (16): redundant with registrations.test.ts
- Redundant role/type checks (3): consolidated into behavioral tests
- "Should not throw" tests (6): consolidated into single lifecycle test
- Constant identity tests (2): provided no safety net
- expect(true).toBe(true) test (1): replaced with actual assertion
- Weak capability test (1): removed, handler check already exists

Strengthened remaining tests:
- Resource templates test now verifies specific resource names
- File resources test now asserts registerResource was called

Test count: 124 → 95 (29 removed)
Coverage unchanged at ~71%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 23:20:05 +02:00
Niels Kaspers
9c0921276c Add tests for server factory, registrations, and resources
Additional test coverage:
- server/index.ts: createServer factory, cleanup function (91% coverage)
- tools/index.ts: registerTools, registerConditionalTools (100% coverage)
- prompts/index.ts: registerPrompts (100% coverage)
- resources/index.ts: registerResources, readInstructions (88% coverage)
- resources/files.ts: registerFileResources (54% coverage)
- resources/subscriptions.ts: handlers, begin/stop updates (47% coverage)

Test count: 124 tests (was 102)
Coverage: 71.35% overall (was 64.73%)
- Tools: 93.12%
- Prompts: 90.53%
- Server: 62.93%
- Resources: 65.44%

Note: Transport files (stdio.ts, sse.ts, streamableHttp.ts) are entry
points that start Express servers. These require integration tests
rather than unit tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 23:20:05 +02:00
Niels Kaspers
f48efe3206 Add tests for remaining 6 tools
Complete test coverage for all 16 Everything Server tools:

New tests added:
- toggle-simulated-logging: start/stop logging toggle, session handling
- toggle-subscriber-updates: start/stop updates toggle, session handling
- trigger-sampling-request: capability check, sampling request/response
- trigger-elicitation-request: capability check, accept/decline/cancel actions
- get-roots-list: capability check, registration
- gzip-file-as-resource: compression, resource/resourceLink output types

Test count: 102 tests (was 81)
Coverage: 64.73% overall, 90.93% tools (was 34%, 40%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 23:20:05 +02:00
Niels Kaspers
93a4f763b6 Add Vitest tests for Everything Server
Adds comprehensive test coverage for the Everything Server including:

Tools (10 tools tested):
- echo: message echoing with validation
- get-sum: number addition with edge cases
- get-env: environment variable retrieval
- get-tiny-image: image content blocks
- get-structured-content: weather data for all cities
- get-annotated-message: priority/audience annotations
- trigger-long-running-operation: progress notifications
- get-resource-links: dynamic resource link generation
- get-resource-reference: text/blob resource validation

Prompts (4 prompts tested):
- simple-prompt: no-argument prompt
- args-prompt: city/state arguments
- completable-prompt: department/name completions
- resource-prompt: embedded resource references

Resources:
- templates.ts: URI generation, text/blob resources
- session.ts: session-scoped resource registration

Test infrastructure:
- vitest.config.ts with v8 coverage
- Mock server helper for capturing registered handlers
- 81 tests, all passing

Closes #2925

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 23:20:05 +02:00
thecaptain789
8614dff06f fix(fetch): update to httpx 0.28+ proxy parameter
The httpx library renamed 'proxies' to 'proxy' in version 0.28.0.
This updates the fetch server to use the new parameter name and
removes the version cap on httpx.

Fixes #3287
2026-02-06 15:25:43 +00:00
Ola Hungerford
10d382798e Merge pull request #3229 from nulone/fix/graceful-unavailable-paths
fix(filesystem): gracefully handle unavailable directories
2026-02-06 06:38:30 -07:00
Ola Hungerford
6a690065cf Merge pull request #3289 from modelcontextprotocol/dependabot/npm_and_yarn/npm_and_yarn-e011e83628
Bump the npm_and_yarn group across 1 directory with 2 updates
2026-02-04 20:20:33 -07:00
dependabot[bot]
e95bb9c44b Bump the npm_and_yarn group across 1 directory with 2 updates
Bumps the npm_and_yarn group with 1 update in the / directory: [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk).


Updates `@modelcontextprotocol/sdk` from 1.25.2 to 1.26.0
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/v1.25.2...v1.26.0)

Updates `hono` from 4.11.3 to 4.11.7
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.11.3...v4.11.7)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.26.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: hono
  dependency-version: 4.11.7
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-04 20:38:38 +00:00
Ola Hungerford
760829a778 Merge pull request #3206 from modelcontextprotocol/chore/apache-2.0-license
chore: update licensing to Apache 2.0 for new contributions
2026-02-04 06:00:33 -07:00
Ola Hungerford
c5df3a4722 Merge pull request #3262 from piyusht-square/add-fetch-server-tests
test(fetch): add unit tests for fetch MCP server
2026-02-04 05:59:59 -07:00
olaservo
dd6594c083 fix(filesystem): use vi.fn() instead of jest.fn() in test
The project uses Vitest, not Jest. Replace jest.fn() with vi.fn()
to fix the ReferenceError in the relative path resolution test.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 05:24:02 -07:00
Ola Hungerford
39a1db9bf2 Merge branch 'main' into claude/issue-2526-20250824-0240 2026-02-03 19:59:23 -07:00
Piyush Tripathi
71d5d71a80 test(fetch): add unit tests for fetch MCP server
Add comprehensive test coverage for the fetch server:
- TestGetRobotsTxtUrl: 6 tests for URL parsing
- TestExtractContentFromHtml: 3 tests for HTML-to-markdown conversion
- TestCheckMayAutonomouslyFetchUrl: 5 tests for robots.txt handling
- TestFetchUrl: 6 tests for URL fetching with various scenarios

Total: 20 tests covering:
- URL parsing and robots.txt URL generation
- HTML content extraction and markdown conversion
- robots.txt permission checking (401, 403, 404, allow/disallow)
- HTTP response handling (success, errors, raw mode)
- Proxy support

Also adds pytest and pytest-asyncio as dev dependencies.
2026-01-28 14:31:01 -08:00
Den Delimarsky
e6b0b0f5d3 Merge pull request #3256 from modelcontextprotocol/localden/security-note
Update security requirements for servers
2026-01-27 15:03:04 -08:00
Den Delimarsky
80397a9d3b Update security requirements for servers
Note about security requirements, as discussed with @jenn-newton
2026-01-26 20:39:39 -08:00
Koichi ITO
b68d67d155 Merge pull request #3255 from modelcontextprotocol/dependabot/uv/src/fetch/uv-a822e4eeeb
Bump the uv group across 3 directories with 1 update
2026-01-27 11:28:09 +09:00
dependabot[bot]
a1f9dfa470 Bump the uv group across 3 directories with 1 update
Bumps the uv group with 1 update in the /src/fetch directory: [python-multipart](https://github.com/Kludex/python-multipart).
Bumps the uv group with 1 update in the /src/git directory: [python-multipart](https://github.com/Kludex/python-multipart).
Bumps the uv group with 1 update in the /src/time directory: [python-multipart](https://github.com/Kludex/python-multipart).


Updates `python-multipart` from 0.0.21 to 0.0.22
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.21...0.0.22)

Updates `python-multipart` from 0.0.21 to 0.0.22
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.21...0.0.22)

Updates `python-multipart` from 0.0.21 to 0.0.22
- [Release notes](https://github.com/Kludex/python-multipart/releases)
- [Changelog](https://github.com/Kludex/python-multipart/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Kludex/python-multipart/compare/0.0.21...0.0.22)

---
updated-dependencies:
- dependency-name: python-multipart
  dependency-version: 0.0.22
  dependency-type: indirect
  dependency-group: uv
- dependency-name: python-multipart
  dependency-version: 0.0.22
  dependency-type: indirect
  dependency-group: uv
- dependency-name: python-multipart
  dependency-version: 0.0.22
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 23:57:45 +00:00
wingding12
8f2e9cc678 fix(filesystem): resolve symlinked allowed directories to both forms
On macOS, /tmp is a symlink to /private/tmp. When users specify /tmp
as an allowed directory, the server was resolving it to /private/tmp
during startup but then rejecting paths like /tmp/file.txt because
they dont start with /private/tmp.

This fix stores BOTH the original normalized path AND the resolved
path in allowedDirectories, so users can access files through either
form. For example, with /tmp as allowed directory, both /tmp/file.txt
and /private/tmp/file.txt will now be accepted.

Fixes #3253
2026-01-26 18:28:49 -05:00
Greg King
3e1be88c3b fix(everything): allow re-registration of session resources
When a tool like `gzip-file-as-resource` is called multiple times with the
same output name (especially the default `README.md.gz`), the server would
throw "Resource already registered" because the SDK doesn't allow
registering duplicate URIs.

This fix:
- Tracks registered resources by URI in a module-level Map
- Before registering a new resource, checks if the URI already exists
- If it does, removes the old resource using the SDK's `remove()` method
- Then registers the new resource with fresh content

This allows tools to be called repeatedly with the same parameters without
errors, which is important for LLM agents that may retry tool calls.

Found using Bellwether (https://bellwether.sh), an MCP server validation tool.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 09:10:58 -05:00
Ola Hungerford
549dd025e2 Merge pull request #3242 from cliffhall/clear-timeouts-in-cleanup
Clear initialization timeout on disconnect
2026-01-24 10:47:19 -07:00
cliffhall
ae1e7a5500 Fix #3234 -
"Everything Server crashes when multiple clients reconnect"

* In index.ts
  - added a variable to hold the initialize timeout
  - store the timeout in the oninitialized handler
  - clear the timeout in the cleanup callback

* In roots.ts
  - In the catch block of syncRoots, log the error to the console via .error rather than attempting to send to the client because the most probable case here is that we don't have a connection.
2026-01-23 13:35:32 -05:00
cliffhall
9ade57133f Fix #3234 -
"Everything Server crashes when multiple clients reconnect"

* In index.ts
  - added a variable to hold the initialize timeout
  - store the timeout in the oninitialized handler
  - clear the timeout in the cleanup callback

* In roots.ts
  - In the catch block of syncRoots, log the error to the console via .error rather than attempting to send to the client because the most probable case here is that we don't have a connection.

* In simulate-research-query.ts
  - remove redundant local variable in getTask
* Everywhere else, prettier.
2026-01-23 13:26:02 -05:00
Cliff Hall
eedb060099 Merge pull request #3193 from olaservo/add-tasks-support
feat(everything): add SEP-1686 Tasks support
2026-01-22 12:44:55 -05:00
olaservo
1542b65154 fix(everything): move task to params.task and remove pollInterval from requests
- Use params.task instead of params._meta.task for task metadata
- Remove pollInterval from task requests (only available on result)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:39:29 -07:00
Ola Hungerford
a160653441 Apply suggestions from code review
Co-authored-by: Cliff Hall <cliff@futurescale.com>
2026-01-21 17:55:10 -07:00