Token导航 LogoToken导航

MCP Server · 搜索检索

MCP Server Osha

一个基于MongoDB的MCP服务器,提供OSHA规则和法规的语义搜索功能,适用于建筑和医疗健康领域。

stdio官方级别未说明来源级核验工具 0
搜索PythonClaudeClaude Desktop

快速开始

作者 / 组织
FINBYTES-algo
提供方
FINBYTES-algo

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

1

仓库热度

收录来源

1 个

MCP World

选型结论

MCP Server Osha 属于搜索检索类 MCP Server,公开资料标注 0 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude,有可以直接复制的安装命令;接入前先确认权限范围。

分类

搜索检索

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

pip install -e .

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 对应的运行时,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

MCP-Server-OSHA(可译为)“MCP服务器-OSHA(职业安全健康管理局)”或根据具体语境简化为“MCP服务器符合OSHA标准”等,但直接翻译保持原样时为“MCP-服务器-OSHA”。不过,通常在实际应用中,我们可能会根据上下文调整翻译,以更贴合实际需求或语境。如果“MCP-Server”是一个特定产品或系统的名称,且“OSHA”指的是美国职业安全健康管理局(Occupational Safety and Health Administration),那么可以翻译为“符合OSHA标准的MCP服务器”或“MCP服务器(符合OSHA标准)”。但在此直接翻译的语境下,保持原样或稍作调整为“MCP-服务器-OSHA(符合OSHA标准)”较为合适

针对建筑和医疗行业的OSHA服务器

MCP MongoDB OSHA 服务器

一个MCP服务器,能够在包含OSHA(美国职业安全卫生管理局)规则和规定的两个MongoDB集合之间提供语义搜索功能。

特点/功能

  • 在OSHA健康和建筑数据库中进行语义搜索
  • 使用xAI Grok API的向量嵌入
  • 用于相关性评分的余弦相似度
  • 详细规则检索

设置

  1. 安装依赖项:
pip install -e .
###################Documentaions###
MCP OSHA Vector Search Server - Implementation Documentation
📋 Project Overview
Problem Statement
Create an MCP (Model Context Protocol) server that provides semantic search capabilities across OSHA regulations stored in MongoDB, using vector embeddings for natural language queries.
Key Objectives
Connect to MongoDB with OSHA health and construction regulations
Implement semantic search using vector embeddings
Create MCP-compliant server for integration with AI assistants
Deploy as accessible web service
🏗️ Architecture Summary
System Components
text
MCP OSHA Server
├── MongoDB Connection (2 databases)
│   ├── osha_health_vector.rules
│   └── osha_construction_vector.rules
├── Vector Embedding Engine
│   └── SentenceTransformers (all-MiniLM-L6-v2)
├── MCP Protocol Layer
│   ├── Tools (search_osha_rules, search_by_identifier, get_rule_details)
│   └── Resources (info, sample-queries)
└── Deployment Target
    └── Google Cloud Run
Data Flow
User Query → Natural language input
Embedding Generation → SentenceTransformers creates query vector
Vector Search → Cosine similarity with stored document vectors
Results Ranking → Sort by similarity score
MCP Response → Formatted results via MCP protocol
🔧 Technical Implementation
Core Technologies
MCP Protocol: Standardized AI tool protocol
Python 3.10: Backend implementation
MongoDB: Document storage with vector embeddings
SentenceTransformers: Local embedding generation
FastAPI: HTTP wrapper for web deployment
Google Cloud Run: Serverless deployment platform
Key Code Components
1. MCP Server Core (server.py)
python
class MongoDBOSHAProcessor:
    def __init__(self):
        # MongoDB connections
        self.health_rules = client['osha_health_vector']['rules']
        self.construction_rules = client['osha_construction_vector']['rules']
        # Embedding model
        self.model = SentenceTransformer('all-MiniLM-L6-v2')
    
    async def search_rules_semantic(self, query: str, database: str, limit: int):
        # Generate query embedding
        query_embedding = self.get_embedding(query)
        # Calculate cosine similarity
        similarity = self.cosine_similarity(query_embedding, doc_vector)
        # Return ranked results
2. MCP Tools Implementation
search_osha_rules: Semantic search with natural language
search_by_identifier: Exact match search by regulation codes
get_rule_details: Retrieve full document details
Vector Search Strategy
Embedding Model: all-MiniLM-L6-v2 (384 dimensions)
Similarity Metric: Cosine similarity
Threshold: > 0.1 similarity score
Local Processing: No external API dependencies
🚀 Deployment Journey
Development Phases
Phase 1: Local MCP Server
✅ Basic MCP server structure
✅ MongoDB connection testing
✅ Vector search implementation
✅ MCP Inspector integration
Phase 2: Cloud Deployment
✅ Docker containerization
✅ Cloud Run configuration
✅ HTTP/SSE transport layer
✅ Web client interface
Phase 3: Production Readiness
✅ Error handling and logging
✅ Health checks
✅ CORS configuration
✅ Resource optimization
Deployment Options Evaluated
Google Cloud Run (Selected)
Pros: Serverless, auto-scaling, cost-effective
Cons: Cold start times, execution time limits
Google Compute Engine
Pros: Full control, persistent storage
Cons: Manual scaling, higher maintenance
Google Kubernetes Engine
Pros: High scalability, container orchestration
Cons: Complex setup, overkill for this use case
📊 Key Challenges & Solutions
Challenge 1: MCP Protocol Understanding
Problem: Initial confusion between REST API and MCP stdio/SSE protocols
Solution: Implemented proper MCP server with stdio transport, added SSE for web compatibility
Challenge 2: Vector Search Integration
Problem: xAI API dependencies and reliability issues
Solution: Switched to local SentenceTransformers for consistent, fast embeddings
Challenge 3: Deployment Architecture
Problem: MCP servers traditionally use stdio, not HTTP
Solution: Created HTTP proxy and SSE bridge for cloud deployment
Challenge 4: CORS and Web Integration
Problem: Browser security blocking local MCP Inspector calls
Solution: Implemented HTTP server with CORS headers and web client interface
🎯 Key Features Implemented
Core Features
Dual Database Search: Simultaneous search across health and construction regulations
Semantic Understanding: Natural language query processing
Hybrid Search: Both semantic and identifier-based search
Local Embeddings: No external API dependencies
MCP Compliance: Works with Claude Desktop and other MCP clients
Search Capabilities
Natural Language: "construction safety regulations"
Specific Codes: "1926", "29", "1910"
Database Selection: Both, health-only, or construction-only
Result Ranking: By relevance score with similarity metrics
🔌 Integration Points
MCP Clients Supported
Claude Desktop
MCP Inspector
Custom web clients
Direct HTTP API
API Endpoints
text
GET  /health                    # Service health check
GET  /sse                      # MCP over Server-Sent Events
POST /search                   # Semantic search
POST /search-by-identifier     # Code-based search
POST /mcp-proxy               # MCP protocol proxy
📈 Performance Characteristics
Resource Requirements
Memory: 2GB recommended (embedding model loading)
CPU: 2 vCPUs for optimal performance
Storage: Minimal (stateless, connects to MongoDB)
Expected Performance
Embedding Generation: ~100ms per query
Vector Search: ~500ms for 15K documents
Cold Start: 10-15 seconds (model loading)
Warm Performance: <1 second response time
🛠️ Usage Examples
MCP Tool Calls
json
{
  "method": "tools/call",
  "params": {
    "name": "search_osha_rules",
    "arguments": {
      "query": "fall protection requirements",
      "database": "construction",
      "limit": 5
    }
  }
}
Web Client Usage
javascript
// Semantic search
await searchRules("hazardous materials handling", "both", 10);

// Identifier search  
await searchByIdentifier("1926", "construction");
🔮 Future Enhancements
Planned Improvements
Caching Layer: Redis for frequent queries
Advanced Filtering: Date ranges, regulation types
Multi-modal Search: Combine semantic and keyword search
User Analytics: Search pattern tracking
API Rate Limiting: Production-grade throttling
Scalability Considerations
Sharding: Split databases by regulation type
CDN: Cache static resources and common queries
Load Balancing: Multiple region deployment
Monitoring: Comprehensive logging and metrics
💡 Key Learnings
Technical Insights
MCP Protocol: Powerful for AI tool standardization but requires proper transport layer understanding
Vector Search: Local embeddings provide reliability and cost savings over APIs
Cloud Deployment: Stateless design crucial for serverless platforms
Web Integration: SSE bridges gap between MCP stdio and web protocols
Development Process
Iterative Testing: MCP Inspector invaluable for protocol debugging
Modular Design: Separation of concerns enabled smooth cloud migration
Documentation: Comprehensive docs essential for complex protocol implementations
📋 Setup & Deployment Checklist
Prerequisites
MongoDB Atlas cluster with OSHA data
Google Cloud Project
Python 3.10+ environment
MCP client (Claude Desktop or Inspector)
Deployment Steps
Environment configuration (.env file)
Local testing with MCP Inspector
Docker image building and testing
Cloud Run deployment
Web client deployment
Integration testing with target clients
🎉 Success Metrics
Implementation Success
✅ MCP protocol compliance achieved
✅ Vector search functionality working
✅ Cloud deployment operational
✅ Web accessibility accomplished
✅ Performance requirements met
Business Value
Accessibility: Web-based access to OSHA regulations
Usability: Natural language query understanding
Integration: Seamless AI assistant integration
Scalability: Cloud-native, cost-effective deployment

This documentation captures the complete journey from concept to deployed production MCP server, highlighting both technical implementation and strategic decisions made throughout the development process.

##############Example for the MCP sever
https://auth0.com/blog/build-python-mcp-server-for-blog-search/#Testing-the-MCP-Server-with-the-MCP-Inspector

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

语义搜索Python本地部署MongoDBOSHA规则建筑安全医疗健康

支持客户端

Claude DesktopClaude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

查资料带出处

把网页、论文和文档的检索结果连同链接一起带回对话。

站内知识检索

在自己的文档库里做语义搜索,比关键词更贴题。

事实核对

交叉多个来源确认一条信息,减少模型凭记忆作答。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 运行环境,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在搜索检索场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
MCP Server Osha

MCP World · 本页

0stdio有1 个2026-05-17
Baidu Netdisk

MCP World

未标注未说明未标注1 个2026-05-17
Sequentialthinking

MCP.so

1SSE有2 个2026-05-17
Brave Search 433812ff

MCP World

2未说明未标注1 个2026-05-17
mindsdb (430e18)

MCP World

0未说明有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

MCP Server Osha 怎么安装?

公开资料给出的安装命令是 pip install -e .,运行环境为 未标注。装完后按客户端要求写进 MCP 配置,重启客户端生效。

MCP Server Osha 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

MCP Server Osha 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Server Osha 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Server Osha 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP