mcp-expose-resources

tevinric/mcp-expose-resources

3.2

If you are the rightful owner of mcp-expose-resources and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project creates an MCP server that exposes a file as a resource.

Tools
  1. mcp[cli]

    MCP CLI tools for testing and interacting with the server.

MCP Resource Server

This project creates an MCP server that exposes a file as a resource.

Overview

The server exposes a file named mcpreadme.md from your desktop as a resource that can be accessed through the MCP protocol using stdio transport.

Setup Instructions

  1. First, ensure you have the MCP file (mcpreadme.md) on your desktop:

    • If it doesn't exist yet, copy the sample_readme.md from this project to your desktop and rename it to mcpreadme.md:
      cp sample_readme.md ~/Desktop/mcpreadme.md
      
      (On Windows, use copy sample_readme.md %USERPROFILE%\Desktop\mcpreadme.md)
  2. Install the required dependencies:

    pip install -r requirements.txt
    

    or using uv:

    uv pip install -r requirements.txt
    

Running with stdio Transport

Running the server with stdio transport is typically done through an MCP client that communicates with the server via standard input/output. You don't need to run the server independently.

To use the server with an MCP client:

  1. Install the MCP CLI tools if you haven't already:

    pip install "mcp[cli]"
    
  2. Use the MCP CLI to test the server:

    mcp dev server.py
    

    or using uv:

    uv run mcp dev server.py
    

Using with Claude Desktop

To use this server with Claude Desktop:

  1. Install the server in Claude Desktop:

    mcp install server.py
    

    or using uv:

    uv run mcp install server.py
    
  2. In Claude Desktop, you can now access the resource by asking Claude about the readme file.

Accessing the Resource

The server exposes two resources:

  • file://readme - The contents of the readme file
  • file://readme/info - Information about the readme file (size, last modified)

Config required to add to mcp host like Claude:

{ "mcpServers": { "shell": { "command": "/Users/tevin/AppData/Local/Microsoft/WinGet/Packages/astral-sh.uv_Microsoft.Winget.Source_8wekyb3d8bbwe/uv", "args": ["--directory", "/Github/mcp-expose-resources", "run", "server.py"] } } }

Our resource is now exposed and available to add to chats with LLMs via the MCP server