diff --git a/.github/workflows/build-pdf-mcpb.yml b/.github/workflows/build-pdf-mcpb.yml new file mode 100644 index 000000000..3817a1159 --- /dev/null +++ b/.github/workflows/build-pdf-mcpb.yml @@ -0,0 +1,56 @@ +name: Build PDF Server MCPB + +on: + push: + paths: + - 'examples/pdf-server/**' + tags: + - 'pdf-server-v*' + workflow_dispatch: + +defaults: + run: + working-directory: examples/pdf-server + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Remove dev dependencies + run: npm prune --production + + - name: Pack MCPB + run: npx @anthropic-ai/mcpb@latest pack . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: pdf-server-mcpb + path: examples/pdf-server/*.mcpb + retention-days: 30 + + - name: Attach to release + if: startsWith(github.ref, 'refs/tags/pdf-server-v') + uses: softprops/action-gh-release@v2 + with: + files: examples/pdf-server/*.mcpb diff --git a/examples/pdf-server/.mcpbignore b/examples/pdf-server/.mcpbignore new file mode 100644 index 000000000..dc11e182a --- /dev/null +++ b/examples/pdf-server/.mcpbignore @@ -0,0 +1,33 @@ +# Source (dist/ has bundled output) +src/ +*.ts +tsconfig*.json +vite.config.* + +# Root-level HTML template (dist/mcp-app.html is the built version) +/mcp-app.html + +# Dev/test +*.test.* +*.spec.* +__tests__/ +jest.config.* +vitest.config.* +.eslintrc* +.prettierrc* + +# Screenshots and non-icon images +screenshot.* +grid-cell.* +pdf-icon.svg +*.svg + +# Docs (README stays for directory listing) +CHANGELOG* +CONTRIBUTING* +docs/ + +# Build artifacts +*.tsbuildinfo +coverage/ +node_modules/ diff --git a/examples/pdf-server/icon.png b/examples/pdf-server/icon.png new file mode 100644 index 000000000..fb7ea3ec7 Binary files /dev/null and b/examples/pdf-server/icon.png differ diff --git a/examples/pdf-server/manifest.json b/examples/pdf-server/manifest.json new file mode 100644 index 000000000..caac64edd --- /dev/null +++ b/examples/pdf-server/manifest.json @@ -0,0 +1,39 @@ +{ + "manifest_version": "0.3", + "name": "@modelcontextprotocol/server-pdf", + "display_name": "PDF", + "version": "1.0.1", + "description": "Read and interact with PDF files using an interactive viewer with search, navigation, and text extraction", + "author": { + "name": "Anthropic", + "url": "https://www.anthropic.com" + }, + "homepage": "https://github.com/modelcontextprotocol/ext-apps/tree/main/examples/pdf-server", + "repository": { + "type": "git", + "url": "https://github.com/modelcontextprotocol/ext-apps" + }, + "support": "https://github.com/modelcontextprotocol/ext-apps/issues", + "icon": "icon.png", + "server": { + "type": "node", + "entry_point": "dist/index.js", + "mcp_config": { + "command": "node", + "args": ["${__dirname}/dist/index.js", "--stdio"], + "env": {} + } + }, + "tools": [ + { "name": "list_pdfs", "description": "List available PDF files that can be displayed" }, + { "name": "display_pdf", "description": "Display an interactive PDF viewer with search and navigation" }, + { "name": "read_pdf_bytes", "description": "Read a range of bytes from a PDF file (max 512KB per request)" } + ], + "keywords": ["pdf", "documents", "viewer", "reading"], + "license": "MIT", + "compatibility": { + "platforms": ["darwin", "win32", "linux"], + "runtimes": { "node": ">=18.0.0" } + }, + "privacy_policies": ["https://www.anthropic.com/privacy"] +}