This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Five local Tk dialogs exposed as MCP tools (Python 3.10+). | |
| Install (Linux Mint / Ubuntu): | |
| sudo apt install python3-tk | |
| python3 -m venv --system-site-packages .venv | |
| .venv/bin/pip install 'mcp>=1.12,<2' pillow tkintermapview | |
| Run: .venv/bin/python mcp.py --port 8765 | |
| Default: Streamable HTTP at http://127.0.0.1:8000/mcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun make-upload-filename () | |
| (etypecase *upload-filename-generator* | |
| ;; the old behaviour. | |
| (null t) | |
| ;; the new behaviour. | |
| ((or symbol function) | |
| (lambda (&rest args) | |
| (let ((filename (apply *upload-filename-generator* args))) | |
| (when *file-upload-hook* | |
| (funcall *file-upload-hook* filename)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; original implementation | |
| ;; hunchentoot;utils.lisp | |
| ;; | |
| (let ((counter 0)) | |
| (declare (ignorable counter)) | |
| (defun make-tmp-file-name (&optional (prefix "hunchentoot")) | |
| "Generates a unique name for a temporary file. This function is | |
| called from the RFC2388 library when a file is uploaded." | |
| (let ((tmp-file-name | |
| #+:allegro |