Skip to content
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d693199
init sdk and monorepo
fahreddinozcan Nov 22, 2025
60c45dc
init sdk and monorepo
fahreddinozcan Nov 22, 2025
36dddaa
comment cleanup
fahreddinozcan Nov 22, 2025
9f2162d
Merge branch 'CTX7-854' of https://github.com/upstash/context7 into C…
fahreddinozcan Nov 22, 2025
04f30aa
remove bun.lock
fahreddinozcan Nov 22, 2025
7525dbc
cleanup: remove sdk package and deps
fahreddinozcan Nov 22, 2025
fce1dd3
update tsconfigs
fahreddinozcan Nov 22, 2025
3d7eb3f
chore: add temp changelog
fahreddinozcan Nov 22, 2025
cb7adb7
ci: update scripts
fahreddinozcan Nov 22, 2025
5c18d32
ci: update github workflows
fahreddinozcan Nov 22, 2025
b327fc1
fmt: workflows
fahreddinozcan Nov 22, 2025
22f7957
fix: search libraries response type
fahreddinozcan Nov 22, 2025
9a1b43d
ci: update pack-mcpb script
fahreddinozcan Nov 22, 2025
eb3c02f
feat: init ts sdk
fahreddinozcan Nov 22, 2025
83ff961
feat: add commands and http client
fahreddinozcan Nov 22, 2025
e1991c3
update keywords and author
fahreddinozcan Nov 23, 2025
c18c7bc
Merge branch 'master' of https://github.com/upstash/context7 into CTX…
fahreddinozcan Nov 24, 2025
bbc6fcc
update eslint config for mcp
fahreddinozcan Nov 24, 2025
8e8f2f5
include license and readme in build
fahreddinozcan Nov 24, 2025
a59b810
update release.yaml
fahreddinozcan Nov 24, 2025
f4cc0d8
add readme symlink
fahreddinozcan Nov 24, 2025
0f09941
include readme in mcp package
fahreddinozcan Nov 24, 2025
0cb72a0
chore: add canary release workflow and update configs
fahreddinozcan Nov 24, 2025
9db19b7
chore: format files
fahreddinozcan Nov 24, 2025
ecc2fb5
ci: add changeset check workflow
fahreddinozcan Nov 24, 2025
b8a68e6
canary release trigger
fahreddinozcan Nov 24, 2025
8bae3b6
ci: login to npm before release
fahreddinozcan Nov 24, 2025
646454f
bump mcp version on package
fahreddinozcan Nov 24, 2025
b20ac59
remove pr trigger from canary release
fahreddinozcan Nov 24, 2025
22d5118
ci: remove package input
fahreddinozcan Nov 24, 2025
e566213
Merge branch 'CTX7-854' of https://github.com/upstash/context7 into C…
fahreddinozcan Nov 24, 2025
9eb40da
finalize sdk with tests and proper types
fahreddinozcan Nov 24, 2025
b200a79
address reviews
fahreddinozcan Nov 24, 2025
e611098
add client tests
fahreddinozcan Nov 24, 2025
42aa380
feat: use env var automatically
fahreddinozcan Nov 24, 2025
dd29668
add docs
fahreddinozcan Nov 24, 2025
5857c2e
docs: update API documentation and add SDK guides
fahreddinozcan Nov 24, 2025
7e4c4e1
remove docs changes (moving to separate PR)
fahreddinozcan Nov 24, 2025
d47669c
docs: ts sdk docs
fahreddinozcan Nov 24, 2025
de7e38b
update sdk examples
fahreddinozcan Nov 24, 2025
596fcf7
remove docs
fahreddinozcan Nov 25, 2025
8d5e1dc
update build config with tsup
fahreddinozcan Nov 25, 2025
256a44a
cleanup comments
fahreddinozcan Nov 25, 2025
c621695
fix error hangling on http client
fahreddinozcan Nov 25, 2025
cb63f0d
minor fixes
fahreddinozcan Nov 25, 2025
d763419
address reviews
fahreddinozcan Nov 25, 2025
e9af0fd
add txt pagination feature
fahreddinozcan Nov 26, 2025
4445dd8
remove unnecessary types
fahreddinozcan Nov 26, 2025
caf709e
update docs with new paging txt feature
fahreddinozcan Nov 26, 2025
da387f5
Merge branch 'CTX7-855' of https://github.com/upstash/context7 into C…
fahreddinozcan Nov 26, 2025
0ccd2a8
update default format
fahreddinozcan Nov 26, 2025
ce85e46
cleanup
fahreddinozcan Nov 26, 2025
ac6591d
fmt
fahreddinozcan Nov 26, 2025
e14028c
update
fahreddinozcan Nov 26, 2025
1cc13eb
add mcp lint command
fahreddinozcan Nov 26, 2025
1ccb829
update format scripts
fahreddinozcan Nov 26, 2025
201f3f0
fix: update eslint and tsconfig with update
fahreddinozcan Nov 27, 2025
f118d0e
Merge branch 'CTX7-854' of https://github.com/upstash/context7 into C…
fahreddinozcan Nov 27, 2025
2b6ef42
add readme
fahreddinozcan Nov 27, 2025
737b2dd
make default format json
fahreddinozcan Nov 27, 2025
cae4fe6
change docType to mode
fahreddinozcan Nov 27, 2025
7cd69d5
Merge CTX7-855 into CTX7-855-docs
fahreddinozcan Nov 27, 2025
2e7009b
update basic usage
fahreddinozcan Nov 27, 2025
e593dea
Merge branch 'CTX7-855' of https://github.com/upstash/context7 into C…
fahreddinozcan Nov 27, 2025
529fdf3
apply interface changes
fahreddinozcan Nov 27, 2025
24c83b3
Merge master into CTX7-855-docs
fahreddinozcan Nov 28, 2025
a2cda59
remove changeset
fahreddinozcan Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": [],
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}-{datetime}"
}
}
5 changes: 5 additions & 0 deletions .changeset/heavy-papers-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@upstash/context7-mcp": patch
---

Migrate to pnpm monorepo structure
46 changes: 46 additions & 0 deletions .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Canary Release

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to release from (defaults to current branch)"
required: false
type: string

jobs:
canary-release:
name: Canary Release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch || github.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build all packages
run: pnpm build

- name: Publish Snapshot
run: pnpm release:snapshot
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47 changes: 47 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Changeset Check

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
check:
name: Check for Changeset
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check for changeset
uses: actions/github-script@v7
with:
script: |
const { execSync } = require('child_process');

const labels = context.payload.pull_request.labels.map(l => l.name);
if (labels.includes('skip-changeset')) {
console.log('Skipping changeset check for PR with skip-changeset label');
return;
}

const baseSha = context.payload.pull_request.base.sha;
const headSha = context.payload.pull_request.head.sha;

const diff = execSync(
`git diff --name-only ${baseSha}...${headSha}`,
{ encoding: 'utf-8' }
);

const hasChangeset = diff
.split('\n')
.some(file => file.startsWith('.changeset/') && file.endsWith('.md') && !file.includes('README'));

if (!hasChangeset) {
core.setFailed(
'No changeset found. Please add a changeset using `pnpm changeset` or add the "skip-changeset" label if this PR doesn\'t need one (e.g., docs, CI changes).'
);
} else {
console.log('Changeset found!');
}
33 changes: 22 additions & 11 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,38 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: "20"

- name: Cache dependencies
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-bun-
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: bun install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Run linter
run: bun run lint:check
run: pnpm run lint:check

- name: Check formatting
run: bun run format --check
run: pnpm run format:check

- name: Build project
run: bun run build
run: pnpm run build
3 changes: 2 additions & 1 deletion .github/workflows/ecr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
id: build-push
uses: docker/build-push-action@v5
with:
context: .
context: packages/mcp
file: packages/mcp/Dockerfile
platforms: linux/amd64
push: true
tags: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# Remove 'v' prefix if it exists
VERSION="${VERSION#v}"
else
VERSION=$(node -p "require('./package.json').version")
VERSION=$(node -p "require('./packages/mcp/package.json').version")
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION"
Expand Down
113 changes: 59 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,89 @@
name: Release

on:
release:
types:
- published
push:
branches:
- master

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC authentication with MCP Registry
contents: read
contents: write
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set env
run: |
VERSION="${GITHUB_REF##refs/*/}"
# Remove 'v' prefix if it exists
VERSION="${VERSION#v}"
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version: "20"

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
bun-version: latest
version: 9

- name: Set package version
- name: Configure npm authentication
run: |
echo $(jq --arg v "${{ env.VERSION }}" '(.version) = $v' package.json) > package.json

- name: Update version in source file
run: |
sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"${{ env.VERSION }}\"/" src/index.ts

- name: Update package version in server.json
run: |
echo $(jq --arg v "${{ env.VERSION }}" '.version = $v | .packages[0].version = $v' server.json) > server.json
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Install Dependencies
run: bun install

- name: Build
run: bun run build
run: pnpm install --frozen-lockfile

- name: Set NPM_TOKEN
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
- name: Build all packages
run: pnpm build

- name: Publish
if: "!github.event.release.prerelease"
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: "chore(release): version packages"
title: "chore(release): version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Check if MCP was published
id: check-mcp
if: steps.changesets.outputs.published == 'true'
run: |
npm pkg delete scripts.prepare
npm publish --access public

- name: Publish release candidate
if: "github.event.release.prerelease"
PUBLISHED='${{ steps.changesets.outputs.publishedPackages }}'
if echo "$PUBLISHED" | jq -e '.[] | select(.name == "@upstash/context7-mcp")' > /dev/null; then
VERSION=$(echo "$PUBLISHED" | jq -r '.[] | select(.name == "@upstash/context7-mcp") | .version')
echo "mcp_published=true" >> $GITHUB_OUTPUT
echo "mcp_version=$VERSION" >> $GITHUB_OUTPUT
fi

- name: Update version in MCP source file
if: steps.check-mcp.outputs.mcp_published == 'true'
run: |
npm pkg delete scripts.prepare
npm publish --access public --tag=canary

- name: Validate server.json
if: "!github.event.release.prerelease"
run: npx mcp-registry-validator validate server.json

- name: Install MCP Publisher
if: "!github.event.release.prerelease"
VERSION="${{ steps.check-mcp.outputs.mcp_version }}"
sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"$VERSION\"/" packages/mcp/src/index.ts
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add packages/mcp/src/index.ts
git commit -m "chore: update MCP version in source to $VERSION" || true
git push || true

- name: Update server.json
if: steps.check-mcp.outputs.mcp_published == 'true'
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.3.3/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

- name: Login to MCP Registry
if: "!github.event.release.prerelease"
run: ./mcp-publisher login github-oidc
VERSION="${{ steps.check-mcp.outputs.mcp_version }}"
echo $(jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json) > server.json
git add server.json
git commit -m "chore: update server.json to v$VERSION" || true
git push || true

- name: Publish to MCP Registry
if: "!github.event.release.prerelease"
run: ./mcp-publisher publish
if: steps.check-mcp.outputs.mcp_published == 'true'
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.3.3/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
./mcp-publisher login github-oidc
./mcp-publisher publish
28 changes: 28 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dependencies
node_modules

# Lock files
pnpm-lock.yaml
package-lock.json
yarn.lock
bun.lockb

# Build outputs
dist
build
.next
out

# Logs
*.log

# Environment files
.env
.env.*

# IDE
.vscode
.idea

# Changesets
.changeset/*.md
Loading