sumit-server / README.md
sumitasthaai's picture
Add Turso database integration and environment variable support
8f3faab unverified
metadata
license: mit
title: SUMIT SERVER MCP
sdk: docker
emoji: πŸš€
colorFrom: yellow
colorTo: green
short_description: THIS IS MCP SERVER.

Tatva MCP Server πŸš€

License: MIT Python 3.13+ FastMCP

SAFE-MCP Verified
222/300 β€’ LOW
Valid: Nov 2025 - Feb 2026

A Model Context Protocol (MCP) server that provides intelligent access to content from the Tatva website (tatva.sumityadav.com.np). This server enables AI assistants to fetch, analyze, and interact with blog posts, pages, and resources from the Tatva platform.

✨ Features

  • Content Fetching: Retrieve content from any page on the Tatva website
  • Blog Post Management: Access and search through all blog posts
  • Smart Search: Find posts by keywords or filter by year
  • Task Management: Store and retrieve tasks using Turso (libSQL) database
  • Resource Access: Direct access to homepage, about page, and specific posts
  • Analysis Tools: Built-in prompts for post analysis and comparison
  • Docker Support: Easy deployment with containerization
  • Hugging Face Spaces Ready: Optimized for HF Spaces deployment
  • Environment Configuration: Automatic loading of environment variables from .env file

πŸ› οΈ Available Tools

Content Retrieval

  • get_page_content(url) - Fetch content from any specific URL
  • get_homepage_content() - Get homepage content
  • get_about_page() - Get about page content
  • get_post_content(post_path) - Get specific blog post content

Blog Management

  • get_all_posts_summary() - List all available blog posts
  • search_posts_by_keyword(keyword) - Search posts by keyword
  • get_posts_by_year(year) - Filter posts by publication year

Task Management

  • put_task_to_db(task, time_date) - Add a task to the database with date and time
  • get_task_from_db(today_date) - Retrieve all tasks for a specific date

Resources

  • tatva://homepage - Homepage resource
  • tatva://about - About page resource
  • tatva://posts/{post_path} - Specific post resource

Analysis Prompts

  • analyze_post_prompt(post_path) - Generate analysis prompt for a post
  • compare_posts_prompt(post1, post2) - Generate comparison prompt for two posts

πŸš€ Quick Start

Prerequisites

  • Python 3.13+
  • uv package manager

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/sumit-mcp-server.git
    cd sumit-mcp-server
    
  2. Install dependencies

    uv sync
    
  3. Configure environment variables

    Create a .env file in the project root with your Turso credentials:

    TURSO_AUTH_TOKEN=your_turso_auth_token
    TURSO_DATABASE_URL=your_turso_database_url
    PORT=7860
    

    The server will automatically load these from the .env file.

  4. Run the server

    uv run server.py
    

The server will start on http://localhost:7860 with the MCP endpoint at /api/mcp/.

Docker Deployment

  1. Build the image

    docker build -t tatva-mcp-server .
    
  2. Run the container

    docker run -p 7860:7860 tatva-mcp-server
    

πŸ“– Usage Examples

Fetching Content

# Get homepage content
homepage = get_homepage_content()

# Get a specific blog post
post = get_post_content("2025/09/22/advance_scanner/")

# Search for posts about AI
ai_posts = search_posts_by_keyword("AI")

Using with MCP Clients

The server exposes MCP tools that can be used by compatible AI assistants and clients. Connect to the server endpoint and use the available tools for content retrieval and analysis.

πŸ—οΈ Project Structure

sumit-mcp-server/
β”œβ”€β”€ server.py          # Main MCP server implementation
β”œβ”€β”€ pyproject.toml     # Project configuration and dependencies
β”œβ”€β”€ Dockerfile         # Container configuration
β”œβ”€β”€ README.md          # This file
β”œβ”€β”€ .env               # Environment variables (create with your Turso credentials)
β”œβ”€β”€ .gitignore         # Git ignore rules
└── uv.lock           # Dependency lock file

πŸ”§ Configuration

The server is configured to work with:

  • Base URL: https://tatva.sumityadav.com.np
  • Port: 7860 (configurable via PORT environment variable)
  • Transport: Server-Sent Events (SSE)
  • Path: /api/mcp/

🌐 Deployment

Hugging Face Spaces

This server is optimized for deployment on Hugging Face Spaces:

  • Uses port 7860 (HF Spaces standard)
  • Includes proper Docker configuration
  • Supports SSE transport for real-time communication

Environment Variables

The server automatically loads environment variables from a .env file in the project root. Create a .env file with:

  • TURSO_AUTH_TOKEN: Authentication token for Turso database (required)
  • TURSO_DATABASE_URL: Database URL for Turso (libSQL) connection (required)
  • PORT: Server port (default: 7860, optional)

Note: The .env file is automatically ignored by git to keep your credentials secure. You can also set these as system environment variables if preferred.

πŸ“ API Reference

Tools

Tool Description Parameters
get_page_content Fetch content from any URL url: str
get_homepage_content Get homepage content None
get_about_page Get about page content None
get_post_content Get specific post content post_path: str
get_all_posts_summary List all posts None
search_posts_by_keyword Search posts keyword: str
get_posts_by_year Filter by year year: str
put_task_to_db Add task to database task: str, time_date: str
get_task_from_db Get tasks for date today_date: str

Resources

Resource Description
tatva://homepage Homepage content
tatva://about About page content
tatva://posts/{path} Specific post content

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links

πŸ“ž Support

For support, questions, or contributions, please open an issue on GitHub or contact the maintainer.


Made with ❀️ for the Tatva Sumit