Skip to main content
Glama
limouren01

MCP File Management Framework

by limouren01
resources_register_plugin.py701 B
import os from typing import Dict, Union, Optional from config import config def register_resource_plugins(mcp): db_host = config.DB_HOST db_name = config.DB_NAME @mcp.resource(uri=f"mysql://{db_host}/{db_name}") def db_connector() -> Dict[str, Union[object, callable]]: """ 注册数据库连接资源。 :return: 包含创建的数据库连接和关闭连接方法的字典。 """ from resources.mysql import create_connection, close_connection conn = create_connection() return { 'connection': conn, 'close': lambda: close_connection(conn) }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/limouren01/mcp-framework'

If you have feedback or need assistance with the MCP directory API, please join our Discord server