Skip to content

A Model Context Protocol (MCP) server that provides tools for fetching dependency information from Clojars, the Clojure community's artifact repository.

Notifications You must be signed in to change notification settings

Bigsy/Clojars-MCP-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojars MCP Server

A Model Context Protocol (MCP) server that provides tools for fetching dependency information from Clojars, the Clojure community's artifact repository.

Features

  • Get the latest version of any Clojars dependency
  • Simple, focused responses
  • Easy integration with Claude through MCP

How It Works

When this MCP server is configured in Claude's settings, it automatically becomes available in Claude's system prompt under the "Connected MCP Servers" section. This makes Claude aware of the server's capabilities and allows it to use the provided tools through the use_mcp_tool command.

The server exposes a tool called get_clojars_latest_version with the following schema:

{
  "name": "get_clojars_latest_version",
  "description": "Get the latest version of a Clojars dependency (Maven artifact)",
  "inputSchema": {
    "type": "object",
    "properties": {
      "dependency": {
        "type": "string",
        "description": "Clojars dependency name in format \"group/artifact\" (e.g. \"metosin/reitit\")"
      }
    },
    "required": ["dependency"]
  }
}

The tool name and description are specifically designed to help Claude understand that this tool is for retrieving the latest version of Clojars dependencies. When users ask about Clojars dependency versions, Claude can recognize that this tool is appropriate for the task based on:

  • The tool name get_clojars_latest_version explicitly indicates it fetches the latest version from Clojars
  • The description specifies it's for "Clojars dependency (Maven artifact)"
  • The example format shows a typical Clojars dependency pattern

Installation

  1. Clone this repository:
git clone https://github.com/yourusername/clojars-deps-server.git
cd clojars-deps-server
  1. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Add the server to your Claude configuration:

For VSCode Claude extension, add to cline_mcp_settings.json (typically located at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/ on macOS):

{
  "mcpServers": {
    "clojars-deps-server": {
      "command": "node",
      "args": ["/path/to/clojars-deps-server/build/index.js"]
    }
  }
}

For Claude desktop app, add to claude_desktop_config.json (typically located at ~/Library/Application Support/Claude/ on macOS):

{
  "mcpServers": {
    "clojars-deps-server": {
      "command": "node",
      "args": ["/path/to/clojars-deps-server/build/index.js"]
    }
  }
}

After adding the server configuration, Claude will automatically detect and connect to the server on startup. The server's capabilities will be listed in Claude's system prompt under "Connected MCP Servers", making them available for use.

Example Usage

When you ask Claude about Clojars dependencies, it will recognize that this tool is appropriate based on its name and description. Here's an example:

Human: What's the latest version of metosin/reitit?
Assistant: Let me check the Clojars repository for that information.
[Uses get_clojars_latest_version tool]
Response:
{
  "dependency": "metosin/reitit",
  "latest_version": "0.7.2"
}

The tool returns just the essential information:

  • The dependency name
  • Its latest version

This focused response format makes it easy to quickly get the version information you need.

Development

The server is built with TypeScript and uses:

  • @modelcontextprotocol/sdk for MCP server implementation
  • axios for making HTTP requests to the Clojars API

To make changes:

  1. Edit the source code in src/index.ts
  2. Run npm run build to compile
  3. Restart Claude to pick up the changes

Error Handling

The server handles various error cases:

  • Invalid dependency format (must be "group/artifact")
  • Dependency not found on Clojars
  • API errors from Clojars

Error responses include descriptive messages to help troubleshoot issues.

About

A Model Context Protocol (MCP) server that provides tools for fetching dependency information from Clojars, the Clojure community's artifact repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published