Cover image
Try Now
2025-04-14

使用模型上下文协议在实体POD中访问数据

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

solid-mcp

GitHub license npm version build Dependabot semantic-release

⚠️ WARNING: This entire project was created by generative AI and has not been reviewed or tested by a human yet. Use with caution in production environments.

Anthropic Model Context Protocol (MCP) integration for the Solid protocol.

This library enables AI models like Claude to access and manipulate data stored in Solid pods through the Model Context Protocol. It allows AI systems to read, write, search, and manage resources in Solid pods while respecting user privacy and control over their data.

Features

  • 🔄 Seamless integration between Anthropic's MCP and Solid pods
  • 📁 Read and write resources in Solid pods
  • 🔍 Search for resources and contents
  • 📂 Create and manage containers
  • 🔐 Authentication support for secure pod access
  • 🧰 Tool-based API for integration with AI models
  • 📊 Structured data handling

Installation

npm install @jeswr/solid-mcp

Usage

Basic Setup

import { createSolidMCPServer, SolidPodConfig } from '@jeswr/solid-mcp';

// Configure access to a Solid Pod
const config: SolidPodConfig = {
  podUrl: 'https://example.solidcommunity.net/',
  auth: {
    type: 'bearer',
    token: 'your-solid-access-token',
  }
};

// Create the MCP server
const server = createSolidMCPServer(config);

Reading a Resource

// Example MCP request to read a resource
const request = {
  action: 'read_resource',
  parameters: {
    uri: '/profile/card',
    include_content: true,
  },
};

// Handle the request
const response = await server.handleRequest(request);
console.log('Response:', response);

Writing a Resource

// Example MCP request to write a resource
const request = {
  action: 'write_resource',
  parameters: {
    uri: '/examples/hello.txt',
    content: 'Hello, Solid World!',
    content_type: 'text/plain',
  },
};

// Handle the request
const response = await server.handleRequest(request);
console.log('Response:', response);

Listing Container Contents

// Example MCP request to list a container
const request = {
  action: 'list_container',
  parameters: {
    uri: '/examples/',
  },
};

// Handle the request
const response = await server.handleRequest(request);
console.log('Response:', response);

Searching for Resources

// Example MCP request to search for resources
const request = {
  action: 'search',
  parameters: {
    container_uri: '/',
    search_term: 'profile',
    recursive: true,
  },
};

// Handle the request
const response = await server.handleRequest(request);
console.log('Response:', response);

API Reference

createSolidMCPServer(config: SolidPodConfig): SolidMCPServer

Creates a new MCP server for a Solid Pod.

SolidClient

Client for interacting with a Solid Pod.

  • readResource(uri: string, includeContent?: boolean): Promise<SolidResourceResponse>
  • writeResource(uri: string, content: any, contentType: string): Promise<SolidResourceResponse>
  • deleteResource(uri: string): Promise<boolean>
  • createContainer(uri: string): Promise<SolidResourceResponse>

SolidMCPServer

MCP server for Solid Pod integration.

  • handleRequest(request: any): Promise<any>
  • getService(): SolidMCPService

Integration with Anthropic Claude

This library makes it easy to integrate Solid pods with Anthropic's Claude AI through the Model Context Protocol. Claude can access and manipulate data in Solid pods while respecting user privacy and control.

Example Claude Integration

// In your Claude MCP client implementation
const solidMCPServer = createSolidMCPServer({
  podUrl: 'https://example.solidcommunity.net/',
  auth: { type: 'bearer', token: 'your-solid-access-token' }
});

// When Claude needs to access data
const claudeRequest = {
  action: 'read_resource',
  parameters: { uri: '/notes/important.txt' }
};

const response = await solidMCPServer.handleRequest(claudeRequest);
// Provide the response to Claude for context

Running Examples

The library includes example code showing how to use the various features:

npm run example

License

©2025–present Jesse Wright, MIT License.

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

    Reviews

    3 (4)
    Avatar
    user_AhWb4CDZ
    2025-04-24

    As a devoted user of solid-mcp, I can confidently say that this application by jeswr has revolutionized my workflow. Its robust features and user-friendly interface make it an indispensable tool for my daily tasks. I highly recommend it to anyone seeking efficiency.

    Avatar
    user_b8fBjmrY
    2025-04-24

    I've been using solid-mcp by jeswr and I'm thoroughly impressed. The seamless integration and user-friendly interface have made it an essential tool in my daily routine. Its reliability and efficiency stand out, making it a top choice for anyone needing a robust MCP application. Highly recommend!

    Avatar
    user_PDe2PVmd
    2025-04-24

    I've been using solid-mcp by jeswr and it's been a game-changer! The product's intuitive interface and robust functionality make managing my projects a breeze. Highly recommend it to anyone looking for an efficient management tool.

    Avatar
    user_hYsPGdwY
    2025-04-24

    I've been using solid-mcp by jeswr and it's absolutely fantastic! The application is incredibly user-friendly and has significantly improved my daily workflow. The seamless integration and solid performance make it stand out among other options. Highly recommend giving it a try!