Skip to main content
Glama
rajeevchandra

SQL Query MCP Server

resources.cpython-311.pyc1.65 kB
� ��h�����ddlmZmZddlmZmZddlmZed��Ze� d��d���Z e� d��de d e efd ���Zd S) �)�inspect�text)� SessionLocal�engine)�FastMCP�postgresz table://listc�R�tt��}|���S)N)rr�get_table_names)� inspectors �/app/src/mcp_ext/resources.py� list_tablesr s������I� � $� $� &� &�&�z sql://query�query�returnc��t��5}|�t|����}d�|D��cddd��S#1swxYwYdS)Nc�6�g|]}t|j����S�)�dict�_mapping)�.0�rows r � <listcomp>zrun_query.<locals>.<listcomp>s"��5�5�5�s��S�\�"�"�5�5�5r)r�executer)r�session�results r � run_queryr s��� ���6�7�����e���-�-��5�5�f�5�5�5�6�6�6�6�6�6�6�6�6�6�6�6����6�6�6�6�6�6s�.A � A�AN)� sqlalchemyrr� db.connectionrr�mcp.server.fastmcpr�mcp�resourcer �tool�str�listrrrrr �<module>r%s���$�$�$�$�$�$�$�$�.�.�.�.�.�.�.�.�&�&�&�&�&�&� �g�j�������n���'�'���'����-���6�S�6�T�$�Z�6�6�6���6�6�6r

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/rajeevchandra/mcp-ollama-postgres'

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