Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[v2] URI template strict expansions leave !'()* unencoded

Open Beginner friendly
#2,919 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api

Research direction

Start with packages/core-internal/src/shared/uriTemplate.ts, focusing on UriTemplate.expand() and encodeValue(), then run the repro.mjs example with Node.js 24 or later. Done means simple and query expansions percent-encode !'()* as shown, while reserved and fragment expansions retain their permitted characters.

Written by the indexing model from the issue text.

Description

v1 v2
What happened?

UriTemplate.expand() leaves !'()* unchanged in simple expansions. Query values have the same problem: search{?q} with q: 'hello!' produces search?q=hello!.

encodeURIComponent() leaves these characters unchanged, and encodeValue() returns that output directly for strict expansion operators.

What did you expect?

Expected output from the snippet below:

%21%27%28%29%2A
search?q=hello%21

RFC 6570 section 3.2.1 permits unreserved characters in strict variable expansions. The five characters above are reserved and need percent-encoding. Reserved and fragment expansions can keep them.

Code to reproduce

Save this as repro.mjs at the SDK repository root and run node repro.mjs with Node.js 24 or later. It imports the source module directly.

import { UriTemplate } from './packages/core-internal/src/shared/uriTemplate.ts';

const value = "!'()*";
console.log(new UriTemplate('{value}').expand({ value }));
console.log(new UriTemplate('search{?q}').expand({ q: 'hello!' }));

Current output:

!'()*
search?q=hello!
SDK version

main at e16d27729ea2fae144a6d957fd0372d9eb0e6c58 (v2 source checkout). Tested with Node.js 24.12.0.

Area

Other

Dominant language
TypeScript
Stars
13.5k
Forks
2.2k
Avg merge
2d 16h
Merged PRs (30d)
46

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/typescript-sdk

All issues in modelcontextprotocol/typescript-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.