Skip to main content
Glama
jgordini

UAB Research Computing Documentation MCP Server

by jgordini
uab_docs_server.cpython-313.pyc25 kB
� ��i�V� ��SrSSKJrJr SSKrSSKrSSKrSSKrSSKJ r \R"\RS\R"5/S9 \R"\5r\ "S5r\R#5S/S\S \4S jj5r\R#5S \4S j5r\R#5S0S \S \4S jj5r\R#5S \4Sj5r\R#5S \4Sj5rSrSrSrSrSr\R:R=S5rSr S\S \4Sjr!\ 4S\S\"S \4Sjjr#S1S\S\$\\4S-S \$\\4\-S-4Sjjr%\RMSSSS .S!9S2S"\\S#4S$\\"S%4S \4S&jj5r'\RMSSSS .S!9S'\\S(4S \4S)j5r(\RMSSSS .S!9S \4S*j5r)\RMSSSS .S!9S \4S+j5r*\RMSSSS .S!9S \4S,j5r+S-r,\S.:Xa\,"5 gg)3a� UAB Research Computing Documentation MCP Server This MCP server provides access to the University of Alabama at Birmingham's Research Computing documentation, allowing AI assistants to search and retrieve relevant information about UAB's research computing resources, including: - Cheaha HPC cluster documentation - Getting support and office hours - Contributing to documentation - Research computing services Homepage: https://docs.rc.uab.edu �)�Any� AnnotatedN)�FastMCPz4%(asctime)s - %(name)s - %(levelname)s - %(message)s)�level�format�handlerszuab-research-computing-docs�topic�returnc��SUS3$)a= Search UAB Research Computing documentation for help with a specific topic. Useful for finding information about Cheaha HPC, SLURM jobs, software, storage, and other research computing topics. Args: topic: The topic to search for (default: "getting started") Returns: A prompt to search the documentation zNPlease search the UAB Research Computing documentation for information about 'z�'. Use the search_documentation tool to find relevant pages, then retrieve the full content of the most relevant page using get_documentation_page.�)r s �uab_docs_server.py�search_cheaha_helpr"s��^�^c�]d�e8� ;�;�c��g)z� Get help with submitting SLURM jobs on Cheaha HPC cluster. Provides guidance on creating job scripts, resource requests, and best practices for job submission. Returns: A prompt to guide job submission assistance aPlease help me understand how to submit a SLURM job on the Cheaha HPC cluster. Search the documentation for 'SLURM tutorial' or 'job submission', then provide step-by-step guidance including how to create a job script, request resources, and submit the job.r r rr �how_to_submit_slurm_jobr5s�� r� software_namec��SUSUS3$)a Find information about available software on Cheaha HPC. Helps users locate and use specific software packages, including how to load modules and check versions. Args: software_name: The name of the software to find Returns: A prompt to search for software information z&Please help me find information about z; on the Cheaha HPC cluster. Search the documentation for 'z�' and provide information about: - How to load the module - Available versions - Usage examples - Any special configuration neededr )rs r �find_available_softwarerFs%��6�m�_�E�,�o�.#� &�&rc��g)z� Get information about UAB Research Computing support options. Provides office hours, contact information, and support channels. Returns: A prompt to retrieve support information z�Please provide information about how to get help and support from UAB Research Computing, including office hours, contact methods, and the support portal. Use the get_support_info tool.r r rr �get_help_and_supportr\s�� "rc��g)z� Get started with Cheaha HPC cluster. Provides essential information for new users including access, basic usage, and key resources. Returns: A prompt to get quick start information z�Please provide a quick start guide for using the Cheaha HPC cluster at UAB. Include information about access, basic usage, and key topics a new user should learn. Use the get_cheaha_quick_start tool.r r rr �cheaha_getting_startedrks�� (rzhttps://docs.rc.uab.eduzhttps://rc.uab.eduzhttps://api.github.comzuabrc/uabrc.github.iozUAB-RC-MCP-Server/1.0� GITHUB_TOKENi���urlc�2�[R"SSU5$)z� Remove /docs/ path segment from documentation URLs. The /docs/ path is part of the GitHub repository structure but not the actual docs site. Args: url: URL that may contain /docs/ segment Returns: Cleaned URL with /docs/ removed from the path z"(https://docs\.rc\.uab\.edu)/docs/z\1/)�re�sub)rs r �clean_docs_urlr�s�� �6�6�7��� E�Er�content�limitc�R�[U5U::aU$USUnSUSSUS-SS3nX#-$)a Truncate content if it exceeds the character limit. Args: content: The content to potentially truncate limit: Maximum character count (default: CHARACTER_LIMIT) Returns: Truncated content with notice if truncated, otherwise original content NuD --- ⚠️ **Content Truncated**: This response was truncated at �,z characters (approximately �z� tokens) to stay within reasonable limits. The full content may be larger. Consider requesting specific sections if you need more detail. )�len)rr � truncated�truncation_notices r �truncate_contentr'�so�� �7�|�u��������I�b�ch�ij�bk�lG�HM�OP�HP�QR�GS�S^�_�� � (�(r�headersc���# �S[0nU(aURU5 [R"5IShv�N nUR XSSS9IShv�N nUR 5 UR R SS5nSU;a!UR5sSSS5IShv�N $URsSSS5IShv�N $N�NvN&N ![Ra3n[RS U35 SnASSS5IShv�N gSnAf[a6n[RS US U35 SnASSS5IShv�N gSnAff=f!,IShv�N (df  g=f7f) z0Make an HTTP request with proper error handling.� User-AgentN�>@T)r(�timeout�follow_redirectsz content-type�zapplication/jsonzHTTP error occurred: zError making request to z: ) � USER_AGENT�update�httpx� AsyncClient�get�raise_for_statusr(�json�text� HTTPError�logger�error� Exception)rr(�default_headers�client�response� content_type�es r �make_http_requestr@�s/���$�Z�0�O�����w�'�� � �"�"�f� �#�Z�Z��d�T�(���H� � %� %� '�$�+�+�/�/���C�L�!�\�1��}�}��#�"�"� �}�}�#�"�"��#����� � �L�L�0���4� 5��#�"�"�� � � �L�L�3�C�5��1�#�>� ?��%#�"�"��  ��!#�"�"�s��:E5�C �E5�E�C�C �AC� E5�(C�)E5�. C�9 E5�C�E5� C�E5�E5�E�'D�?E� E5�D�E5� E�"E�=E� E5� E� E5�E�E�E2�!E$ �" E2�.E5TF)� readOnlyHint�destructiveHint�idempotentHint)� annotations�queryaThe search term or phrase to look for in the UAB Research Computing documentation. Can include keywords related to Cheaha HPC, SLURM, software, storage, or any research computing topic. Examples: 'slurm tutorial', 'python modules', 'data transfer', 'gpu nodes'� max_resultsz�Maximum number of search results to return. Valid range: 1-10. Default is 5. Higher values provide more options but may include less relevant results.c ��# �[US5n[S3nUS[3US.nSS0n[(a S[3US'[R "5IS hv�N nUR UU0UES [0ES S 9IS hv�N nUR5 UR5nS S S 5IS hv�N WR S5(dSUS3$/n U R%SUR SS5SUS35 ['USS US5H�up�U R SS5n U R S S!5n U R S"S!5nU R)S#S!5nUR)S$S!5nUR+S%5(aUS&S nUR-S'5n[.S'U3nS(U S)U S*US+US,U S(3 nU R%U5 M� U R%S-5 S(R1U 5n[3U5$GN�GNz![Ra�n[RS URRSURR35 URRS:XaS nAS S S 5IS hv�N gURRS:XaS nAS S S 5IS hv�N gSURR3sS nAsS S S 5IS hv�N $S nAf[ aBn[RSU35 S[#U53sS nAsS S S 5IS hv�N $S nAff=fGN�!,IS hv�N (df  GN�=f7f).a] Search the UAB Research Computing documentation for relevant content. This tool searches through the documentation repository to find pages that match the search query. Useful for finding information about: - How to use Cheaha HPC cluster - Research computing policies and procedures - Getting support and office hours - Software and tools available - Storage and data management Args: query: The search term or phrase to look for in the documentation max_results: Maximum number of results to return (default: 5, max: 10) Returns: Formatted search results with titles, URLs, and excerpts � z /search/codez repo:)�q�per_page�Acceptzapplication/vnd.github.v3+jsonzBearer � AuthorizationNr*r+)�paramsr(r,z$HTTP error searching documentation: z - i�zhError: GitHub API authentication failed. Set GITHUB_TOKEN environment variable for authenticated access.i�zdError: GitHub API rate limit exceeded. Set GITHUB_TOKEN environment variable for higher rate limits.z$Error searching documentation: HTTP zError searching documentation: �itemszNo results found for 'z.' in the UAB Research Computing documentation.zFound � total_countrz results for 'z': ��name�Unknown�pathr.�html_url�.md�README�docs/��/� z. **z ** URL: z Repository: z Path: ua 💡 Tip: Use the 'get_documentation_page' tool to retrieve the full content of a specific page.)�min�GITHUB_API_BASE� GITHUB_REPOrr1r2r3r/r4r5�HTTPStatusErrorr8r9r=� status_coder6r:�str�append� enumerate�replace� startswith�rstrip� DOCS_BASE_URL�joinr')rErF� search_urlrMr(r<r=�datar?�results�i�item� file_name� file_pathrT� clean_path�doc_url� result_entry� result_texts r �search_documentationrs�sG���N�k�2�&�K�$�$�L�1�J��W�F�;�-�0�k� J�F��9�:�G��|�%,�\�N�#;��� �� � �"�"�f� >�#�Z�Z���=�7�=�L�*�=�� (���H� � %� %� '��=�=�?�D�#�"�. �8�8�G� � �'��w�.\�]�]��G� �N�N�V�D�H�H�]�A�6�7�~�e�W�D�Q�R��T�'�]�<�K�8�!�<����H�H�V�Y�/� ��H�H�V�R�(� ��8�8�J��+���&�&�u�b�1� � �'�'��"�5� � � � �� )� )�#�A�B��J� �&�&�s�+� �#�O�1�Z�L�1�����4� �{� � � ���z� � ��� � � ���|�$�9=�< �N�N� l���)�)�G�$�K� �K� (�(�A#����$�$� S� �L�L�6�q�z�z�7M�7M�6N�c�RS�R\�R\�Ra�Ra�Qb�c� ��z�z�%�%��,�B�#�"�"� ���'�'�3�.�}�##�"�"�$:�!�*�*�:P�:P�9Q�R� R�%#�"�"��&� >� �L�L�:�1�#�>� ?�4�S��V�H�=� =�+#�"�"��& >��'#�"�"�"�s��AM�G6�M�L8� G<�?G9�$G<�$ M�/L5�0EM�9G<�<L2�AK#�-L8�1 M�<I?�=M�K#�L8�! M�,J/�-M�3K#� L2� L8� M�K�M�# L2�0%L-�L2�L8� M�&L)�'M�-L2�2L8�5M�8M�>M �? M� M� page_patha�The path to the documentation page to retrieve. Accepts multiple formats: (1) Repository path: 'docs/cheaha/slurm/slurm_tutorial.md', (2) Short path: 'cheaha/slurm/slurm_tutorial', (3) GitHub URL: 'https://github.com/uabrc/uabrc.github.io/blob/main/docs/...'. The .md extension and docs/ prefix are optional and will be added automatically if needed. Example paths: 'cheaha/getting_started', 'docs/help/support.md', 'storage/quota'c ��V# �URS5(a[SU;aPURS5n[U5S:�a/USRSS5n[U5S:�aUSnO SU3$OSU3$URS5nURS5(dSU3nUR S 5(dUS 3nS [ S U3n[ RS U35 [U5IS hv�N nUc?S [ SU3n[ RSU35 [U5IS hv�N nUcSU3$[U[5(agURSSS5RS S5RS5n[SU3nSUSUSUS[S3 n[U5$N�N7f)a Retrieve the full content of a specific documentation page. This tool fetches the complete markdown content of a documentation page from the UAB Research Computing GitHub repository. Use this after finding a relevant page with the search tool. Args: page_path: The path to the documentation page (e.g., "docs/cheaha/slurm/slurm_tutorial.md" or "cheaha/slurm/slurm_tutorial") Can be a relative path from the repository root or a GitHub URL Returns: The full markdown content of the documentation page �httpz github.comz/blob/rPrYz4Error: Could not extract file path from GitHub URL: z)Error: URL provided is not a GitHub URL: rWrUz"https://raw.githubusercontent.com/z/main/zFetching documentation from: Nz/master/zRetrying with master branch: zLError: Unable to fetch content from GitHub. The file may not exist at path: zfError: Received JSON instead of markdown content. This shouldn't happen with raw.githubusercontent.comr.z# Documentation Page: z **URL:** z --- zF --- **Source:** UAB Research Computing Documentation **Base URL:** rZ)rd�splitr$�lstrip�endswithr]r8�infor@� isinstance�dictrcrerfr')rt�parts� path_parts�raw_urlr� display_path� docs_site_url�results r �get_documentation_pager�=s����D���F�#�#� �9� $��O�O�H�-�E��5�z�A�~�"�1�X�^�^�C��3� ��z�?�Q�&� *�1� �I�Q�R[�Q\�]�]� �?�y�k�J� J�� � ��%�I� � � �� (� (��I�;�'� � � � �e� $� $� �k��%� �3�;�-�v�i�[�Q�G� �K�K�/��y�9�:�&�g�.�.�G���6�{�m�8�I�;�W��� � �3�G�9�=�>�)�'�2�2�� �?�a�bk�al�m� m��'�4� � �x��$�$�W�b�!�4�<�<�U�B�G�N�N�s�S�L�$�o�Q�|�n�5�M�(� �{�3 � ��� � � � �o�� �F� �F� #�#�A/� 3�s%�C+F)�-F%�.9F)�'F'�(A>F)�'F)c��# �S[S[S[S[S[S[S[S[S [S [S [S 3nU$7f) aL Get information about how to get support from UAB Research Computing. This tool provides contact information, office hours, and support channels for UAB Research Computing services. No parameters required. Returns: Comprehensive support information including office hours, contact methods, and links to support resources zM # UAB Research Computing Support Information ## Primary Documentation Site z ## Cheaha Access Portal z� ## Getting Support The UAB Research Computing team provides support through multiple channels: ### Office Hours Visit the documentation site for current office hours information: zU/help/office_hours ### Support Portal For technical support, questions, and issues: zm/help/support ### Contributing to Documentation If you'd like to contribute to improving the documentation: zL/contributing/contributor_guide/ ## Quick Links - **Main Documentation:** z - **Cheaha Login:** z - **Getting Started Guides:** z0/getting-started/ - **Software Documentation:** z!/software/ - **Storage & Data:** a�/storage/ ## About UAB Research Computing UAB Research Computing is part of UAB IT, with a mission to serve and support the UAB Research Community with all of their research computing and data needs. Services include: - High-Performance Computing (Cheaha cluster) - Data storage and management - Research software support - Consultation and training - Cloud computing integration For the most up-to-date information, always refer to the official documentation at rZ)rf� RC_BASE_URL)� support_infos r �get_support_infor��s����$���� � �����������)�/�*� �M�"�,�o�.�,�o�.�$�o�&��?��]/�L�b ��s�AAc��># �S[S[S[S3nU$7f)a? List the main sections and categories available in the UAB Research Computing documentation. This tool provides an overview of the documentation structure to help users understand what information is available. No parameters required. Returns: A structured list of main documentation sections and their purposes a� # UAB Research Computing Documentation Structure The documentation is organized into the following main sections: ## 1. Getting Started Learn the basics of using UAB Research Computing resources - Introduction to Cheaha - Account setup and access - First steps tutorials - Basic HPC concepts ## 2. Help & Support Get assistance with your research computing needs - Office hours schedule - Support portal and ticketing - Contact information - FAQ and troubleshooting ## 3. Software & Applications Information about available software and tools - Installed software catalog - Module system (Lmod) - Custom software installation - Containers (Singularity/Apptainer) - Licensed software access ## 4. Storage & Data Management Managing your research data - Storage systems overview - Quota and allocations - Data transfer methods - Backup and archival - Data security and compliance ## 5. Job Scheduling (SLURM) Running computational jobs on Cheaha - SLURM basics and commands - Job submission scripts - Resource requests - Queue policies - Job arrays and dependencies ## 6. Best Practices Guidelines for effective use of research computing resources - Workflow optimization - Resource efficiency - Reproducible research - Collaboration and sharing ## 7. Contributing How to contribute to the documentation - Contributor guide - Documentation standards - Submitting changes ## Quick Access - **Main Site:** z - **Cheaha Portal:** z- - **GitHub Repository:** https://github.com/z� Use the 'search_documentation' tool to find specific topics within these sections, or 'get_documentation_page' to retrieve full content from a specific page. )rfr�r])�sectionss r �list_documentation_sectionsr��s<���":�t ��!�!�]�#-�-8�M�:�y@�H�D �O�s�c ��Z# �S[S[S[S[S[S3 nU$7f)aE Get quick start information for accessing and using the Cheaha HPC cluster. This tool provides essential information for new users getting started with the Cheaha high-performance computing cluster at UAB. No parameters required. Returns: Quick start guide with essential information for Cheaha access and basic usage a # Cheaha HPC Quick Start Guide ## What is Cheaha? Cheaha is the University of Alabama at Birmingham's high-performance computing (HPC) cluster, providing powerful computational resources for research. ## Getting Started ### 1. Account Creation - Visit the account creation page to set up your Cheaha account - All researchers receive 5 TB of individual storage ### 2. Access Methods **Primary Access - Web Portal (Recommended)** The easiest way to access Cheaha is through the Open OnDemand web portal: **u/** Requirements: - UAB credentials - Duo 2-Factor Authentication **Alternative - SSH Access** For command-line access: ```bash ssh YOUR_BLAZERID@cheaha.rc.uab.edu ``` (Connect to port 22) ### 3. Interactive Applications Available Once logged in through the web portal, you can access: - **File Browser** - Manage your files - **Remote Desktop** - Full desktop environment - **Jupyter Notebook/Lab** - Interactive computing - **RStudio** - R development environment - **MATLAB** - Mathematical computing ## Important Usage Guidelines ⚠️ **Critical Rule**: Do not run compute-intensive tasks on login nodes - Always use SLURM job scheduler for computational work - Choose appropriate partition based on your needs ## Compute Partitions ### GPU Processing - **pascalnodes** - Pascal GPU nodes - **amperenodes** - Ampere GPU nodes ### General Purpose - **amd-hdr100** - General computing ### Time-based Partitions - **express** - Short jobs - **short** - Short-term computing - **medium** - Medium-term jobs - **long** - Long-running jobs ### Specialized - **largemem** - High memory requirements ## Software Access - Software available through the **module system** - **Anaconda recommended** for package management - Need help with software? Submit a support ticket ## Getting Support ### Documentation Home z' ### Support Channels - Office Hours: z%/help/office_hours - Support Portal: a�/help/support ## Next Steps Use the MCP tools to explore specific topics: - `search_documentation("slurm tutorial")` - Learn job submission - `search_documentation("modules")` - Software module system - `search_documentation("partitions")` - Compute node details - `search_documentation("storage")` - Data management **Quick Tip**: Always submit computational jobs through SLURM to utilize compute nodes effectively. For the most current information, always refer to rZ)r�rf)� quick_starts r �get_cheaha_quick_startr�?sY���"�$�-�6�l����� � �/� "3�4A�/�B�qY�K�v ��s�)+c�T�[RS5 [RSS9 g)z"Initialize and run the MCP server.z8Starting UAB Research Computing Documentation MCP Server�stdio)� transportN)r8rz�mcp�runr rr �mainr��s�� �K�K�J�K��G�G�g�G�r�__main__)zgetting started)�Python)N)rX)-�__doc__�typingrr�loggingr1�osr�mcp.server.fastmcpr� basicConfig�INFO� StreamHandler� getLogger�__name__r8r��promptr`rrrrrrfr�r\r]r/�environr3r�CHARACTER_LIMITr�intr'r|r@�toolrsr�r�r�r�r�r rr �<module>r�sh�� �"�� � � �&���� �,�,� A��#�#�%� &�� � � �8� $���+�,������;�c�;�#�;��;�$���� �� �� � ����&�3�&�c�&��&�*���� "�c� "�� "����� (�� (�� (�*� �"� �*��%� � $� ��z�z�~�~��� � �� F�� F�� F� 1@�)�c�)�#�)�C�)�*04�� ���C��H�~��,�� �#�s�(�^�c��D� ��:���� ��� ��& �j)� � � U� U� �j)�� � T� T��j)� �j)��j)�Z���� ��� ��\$�� � [� [� �\$� �\$��\$�~���� ��� ��<��<��<�~���� ��� ��L�3�L��L�^���� ��� ��e�c�e��e�P�  �z���F�r

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/jgordini/rcmcp'

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