npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

somark-mcp

v1.0.0

Published

MCP server for Somark document parsing API - converts PDF and images to markdown/JSON

Readme

Somark MCP Server

English | 中文

A Model Context Protocol (MCP) server for Somark's document parsing API. It converts PDF and image files into Markdown or JSON format with high accuracy.

Quick Start

1. Get your API Keysomark.tech/workbench/apikey

2. Add the following to your MCP client configuration (Claude Desktop, VS Code, Cursor, etc.):

{
  "mcpServers": {
    "somark": {
      "command": "npx",
      "args": ["-y", "github:SoMarkAI/somark_mcp"],
      "env": {
        "SOMARK_API_KEY": "your-api-key-here"
      }
    }
  }
}

3. Done! Ask your AI assistant to parse any PDF or image file.

Available Tools

check_api_key

Check whether the Somark API key is configured and ready to use.

set_api_key

Set or update the Somark API key at runtime (useful when the environment variable is not set).

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | api_key | string | Yes | Your Somark API key from somark.tech |

extract_document

Parse PDF or image files (PNG, JPG, JPEG, BMP, TIFF, JP2, DIB, PPM, PGM, PBM, GIF, HEIC, HEIF, WebP, XPM, TGA, DDS, XBM) to Markdown or JSON format.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | file_path | string | Yes | — | Absolute path to the PDF or image file | | output_format | "markdown" | "json" | No | "markdown" | Output format | | extract_images | boolean | No | false | Whether to extract images from the document | | language | string | No | auto-detect | Language code (e.g., en, zh, ja) |

Supported file formats:

  • PDF (.pdf)
  • PNG (.png)
  • JPEG (.jpg, .jpeg)
  • BMP (.bmp, .dib)
  • TIFF (.tiff, .tif)
  • JPEG 2000 (.jp2)
  • Portable Pixmap (.ppm)
  • Portable Graymap (.pgm)
  • Portable Bitmap (.pbm)
  • GIF (.gif)
  • HEIC (.heic)
  • HEIF (.heif)
  • WebP (.webp)
  • X PixMap (.xpm)
  • Targa (.tga)
  • DirectDraw Surface (.dds)
  • X BitMap (.xbm)

Example usage:

// Parse a PDF to Markdown
{
  "file_path": "/path/to/document.pdf",
  "output_format": "markdown"
}

// Parse an image to JSON with image extraction
{
  "file_path": "/path/to/image.png",
  "output_format": "json",
  "extract_images": true,
  "language": "en"
}

Development

pnpm install          # Install dependencies
pnpm build            # Build the project
pnpm exec tsc --noEmit  # Type check

Testing

pnpm test             # Full MCP server test
pnpm test:api         # API connection test

See test/README.md for details.

Troubleshooting

| Problem | Solution | |---------|----------| | "API key not configured" | Add SOMARK_API_KEY to your MCP client config, or use the set_api_key tool | | Connection issues | Check that your API key is valid and somark.tech is accessible | | Unsupported file format | Supports PDF, PNG, JPG, JPEG, BMP, TIFF, JP2, DIB, PPM, PGM, PBM, GIF, HEIC, HEIF, WebP, XPM, TGA, DDS, XBM formats |

License

ISC