Cover image
Try Now
2025-03-24

mcp server for Apache Jena

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

MCP Server for Apache Jena

A Model Context Protocol (MCP) server that connects AI agents to Apache Jena for SPARQL query capabilities.

Overview

This project implements an MCP server that allows AI agents (such as Cursor, Claude for Cline, or Claude Desktop) to access and query RDF data stored in Apache Jena. The server provides tools for executing SPARQL queries and updates against a Jena Fuseki server.

Features

  • Execute SPARQL queries against a Jena Fuseki server
  • Execute SPARQL updates to modify RDF data
  • List available named graphs in the dataset
  • HTTP Basic authentication support for Jena Fuseki
  • Compatible with the Model Context Protocol

Prerequisites

  • Node.js (v16 or later)
  • Apache Jena Fuseki server running with your RDF data loaded
  • An AI agent that supports the Model Context Protocol (e.g., Cursor, Claude for Cline)

Installation

  1. Clone this repository:

    git clone https://github.com/ramuzes/mcp-jena.git
    cd mcp-jena
    
  2. Install dependencies:

    npm install
    
  3. Build the TypeScript code:

    npm run build
    

Usage

Run the server with default settings (localhost:3030 for Jena, 'ds' for dataset):

npm start

Or specify custom Jena endpoint, dataset, and authentication credentials:

npm start -- --endpoint http://your-jena-server:3030 --dataset your_dataset --username your_username --password your_password

You can also use short flags:

npm start -- -e http://your-jena-server:3030 -d your_dataset -u your_username -p your_password

For development mode with automatic transpilation:

npm run dev:transpile -- -e http://your-jena-server:3030 -d your_dataset -u your_username -p your_password

Available Tools

This MCP server provides the following tools:

  1. execute_sparql_query - Execute a SPARQL query against the Jena dataset
  2. execute_sparql_update - Execute a SPARQL update query to modify the dataset
  3. list_graphs - List all available named graphs in the dataset

Environment Variables

You can also configure the server using environment variables:

  • JENA_FUSEKI_URL: URL of your Jena Fuseki server (default: http://localhost:3030)
  • DEFAULT_DATASET: Default dataset name (default: ds)
  • JENA_USERNAME: Username for HTTP Basic authentication to Jena Fuseki
  • JENA_PASSWORD: Password for HTTP Basic authentication to Jena Fuseki
  • PORT: Port for the MCP server (for HTTP transport, default: 8080)
  • API_KEY: API key for MCP server authentication

Example SPARQL Queries

Basic SELECT query:

SELECT ?subject ?predicate ?object
WHERE {
  ?subject ?predicate ?object
}
LIMIT 10

Insert data with UPDATE:

PREFIX ex: <http://example.org/>
INSERT DATA {
  ex:subject1 ex:predicate1 "object1" .
  ex:subject2 ex:predicate2 42 .
}

Query a specific named graph:

SELECT ?subject ?predicate ?object
FROM NAMED <http://example.org/graph1>
WHERE {
  GRAPH <http://example.org/graph1> {
    ?subject ?predicate ?object
  }
}
LIMIT 10

Resources

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • OffchainLabs
  • Go implementation of Ethereum proof of stake

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

    Reviews

    5 (1)
    Avatar
    user_Roo0uysH
    2025-04-15

    MCP_DEMO by Subin-Vidhu is an outstanding application! The user experience is seamless, and the design is highly intuitive. It's a valuable tool for both beginners and professionals. The developers have done an amazing job ensuring functionality and ease of use. Highly recommend checking it out at https://mcp.so/server/MCP_DEMO/Subin-Vidhu.