Skip to main content
Glama
cli.cpython-311.pyc3.34 kB
� \C�g�� �D�ddlZddlZddlmZddlmZddlmZddlZddl Z ddl m Z ej ��d���Z e ���ejdejd � ��� ��ejd ej��� ��ejd ��ded ed efd���������Ze ���ejdejd � ��� ��defd�����Zedkr e ��dSdS)�N)�Path)�Optional�)� ABIAnalyzer)� MCPGeneratorc��dS)zMCP Server Generator CLIN�r ��//Users/arjun/repos/sparkmango/mcp_server/cli.py�clir s �� �Dr �abi_fileT)�exists)�type� output_dir� contract_namec���tjd��}|stjdd���dSt |��5}t j|��}ddd��n #1swxYwYt|��}|���}t|t|��||���}tj |� ����tjd|����dS)z+Generate an MCP server from a contract ABI.�OPENAI_API_KEYz5Error: OPENAI_API_KEY environment variable is not setT)�errN)�analysisrr�openai_api_keyzMCP server generated in )�os�getenv�click�echo�open�json�loadr�analyzerr�asyncio�run�generate) r rrr�f�abi�analyzerr� generators r r!r!s,���Y�/�0�0�N� �� � �J�PT�U�U�U�U��� �h����1��i��l�l���������������������3���H����!�!�H���� �#�#�#�%� ���I� �K� �"�"�$�$�%�%�%� �J�6�*�6�6�7�7�7�7�7s�A�A#�&A#� cache_dirc���t|��}|���stjd��dS|�d��D]}|����tjd��dS)z&Clear the method implementation cache.zCache directory does not existNz*.pyz Cache cleared)rrrr�glob�unlink)r&� cache_path�files r � clear_cacher,0s{���i���J� � � � � �� � �3�4�4�4�������'�'���� � � � � � � � �J������r �__main__)rr�pathlibr�typingr� abi_analyzerrrr� mcp_generatorr�groupr �command�argument�strr!r,�__name__r r r �<module>r7s��� � � � � � � � �������������%�%�%�%�%�%� � � � �����'�'�'�'�'�'� ����� � ��� ��������� ����4�!8�!8�!8�9�9�9���� �:�5�:�<�<�0�0�0����� � �8�s�8��8�C�8�8�8�!� �1�0�:�9���8�:�������� �*�%�*�D�"9�"9�"9�:�:�:�  �3�  �  �  �;�:���  � �z����C�E�E�E�E�E��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/ArjunBhuptani/sparkmango'

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