androidtvmcp-fastmcp 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,244 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+ memory-bank/
131
+ .clinerules
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
160
+ # project, it is recommended to ignore the entire .idea directory.
161
+ .idea/
162
+
163
+ # VS Code
164
+ .vscode/
165
+ !.vscode/settings.json
166
+ !.vscode/tasks.json
167
+ !.vscode/launch.json
168
+ !.vscode/extensions.json
169
+ !.vscode/*.code-snippets
170
+
171
+ # Local History for Visual Studio Code
172
+ .history/
173
+
174
+ # Built Visual Studio Code Extensions
175
+ *.vsix
176
+
177
+ # macOS
178
+ .DS_Store
179
+ .AppleDouble
180
+ .LSOverride
181
+
182
+ # Icon must end with two \r
183
+ Icon
184
+
185
+ # Thumbnails
186
+ ._*
187
+
188
+ # Files that might appear in the root of a volume
189
+ .DocumentRevisions-V100
190
+ .fseventsd
191
+ .Spotlight-V100
192
+ .TemporaryItems
193
+ .Trashes
194
+ .VolumeIcon.icns
195
+ .com.apple.timemachine.donotpresent
196
+
197
+ # Directories potentially created on remote AFP share
198
+ .AppleDB
199
+ .AppleDesktop
200
+ Network Trash Folder
201
+ Temporary Items
202
+ .apdisk
203
+
204
+ # Windows
205
+ Thumbs.db
206
+ Thumbs.db:encryptable
207
+ ehthumbs.db
208
+ ehthumbs_vista.db
209
+
210
+ # Dump file
211
+ *.stackdump
212
+
213
+ # Folder config file
214
+ [Dd]esktop.ini
215
+
216
+ # Recycle Bin used on file shares
217
+ $RECYCLE.BIN/
218
+
219
+ # Windows Installer files
220
+ *.cab
221
+ *.msi
222
+ *.msix
223
+ *.msm
224
+ *.msp
225
+
226
+ # Windows shortcuts
227
+ *.lnk
228
+
229
+ # Project-specific
230
+ # Android TV certificates and keys
231
+ *.pem
232
+ *.key
233
+ certificates/
234
+
235
+ # MCP server logs
236
+ *.log
237
+ logs/
238
+
239
+ # Temporary files
240
+ *.tmp
241
+ *.temp
242
+ temp/
243
+ tmp/
244
+ devtools/toremove
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pigeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,309 @@
1
+ Metadata-Version: 2.4
2
+ Name: androidtvmcp-fastmcp
3
+ Version: 0.2.1
4
+ Summary: Android TV Remote Control to MCP Bridge
5
+ Project-URL: Homepage, https://github.com/fastmcp-me/androidtvmcp#readme
6
+ Project-URL: Repository, https://github.com/fastmcp-me/androidtvmcp.git
7
+ Project-URL: Issues, https://github.com/fastmcp-me/androidtvmcp/issues
8
+ Author: Pigeek
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: android-tv,mcp,model-context-protocol,remote-control
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Requires-Python: >=3.8
22
+ Requires-Dist: androidtvremote2>=0.1.0
23
+ Requires-Dist: asyncio-mqtt>=0.11.0
24
+ Requires-Dist: click>=8.0.0
25
+ Requires-Dist: mcp>=1.0.0
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: pynput>=1.7.0
28
+ Requires-Dist: zeroconf>=0.131.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: black>=23.0.0; extra == 'dev'
31
+ Requires-Dist: isort>=5.12.0; extra == 'dev'
32
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
33
+ Requires-Dist: pre-commit>=3.0.0; extra == 'dev'
34
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
35
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
36
+ Description-Content-Type: text/markdown
37
+
38
+ [![Add to Cursor](https://fastmcp.me/badges/cursor_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
39
+ [![Add to VS Code](https://fastmcp.me/badges/vscode_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
40
+ [![Add to Claude](https://fastmcp.me/badges/claude_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
41
+ [![Add to ChatGPT](https://fastmcp.me/badges/chatgpt_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
42
+ [![Add to Codex](https://fastmcp.me/badges/codex_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
43
+ [![Add to Gemini](https://fastmcp.me/badges/gemini_dark.svg)](https://fastmcp.me/MCP/Details/1827/androidtvmcp)
44
+
45
+ # AndroidTVMCP - Android TV Remote Control to MCP Bridge
46
+
47
+ A Model Context Protocol (MCP) server that provides Android TV remote control functionality to AI assistants and other MCP clients.
48
+
49
+ ## Overview
50
+
51
+ AndroidTVMCP bridges Android TV remote control capabilities with the Model Context Protocol, enabling seamless integration of Android TV control into AI-powered workflows and automation systems.
52
+
53
+ ## Features
54
+
55
+ - **Device Discovery**: Automatic detection of Android TV devices on the local network
56
+ - **Remote Control**: Full navigation and playback control capabilities
57
+ - **App Management**: Launch and switch between Android TV applications
58
+ - **State Monitoring**: Query device status and current state
59
+ - **MCP Integration**: Standard MCP protocol compliance for easy integration
60
+
61
+ ## Quick Start
62
+
63
+ ### Installation
64
+
65
+ #### Using Virtual Environment (Recommended)
66
+
67
+ ```bash
68
+ # Create a virtual environment
69
+ python -m venv androidtvmcp-env
70
+
71
+ # Activate the virtual environment
72
+ # On Linux/macOS:
73
+ source androidtvmcp-env/bin/activate
74
+ # On Windows:
75
+ # androidtvmcp-env\Scripts\activate
76
+
77
+ # Install the package
78
+ pip install androidtvmcp
79
+ ```
80
+
81
+ #### Global Installation
82
+
83
+ ```bash
84
+ pip install androidtvmcp
85
+ ```
86
+
87
+ ### Basic Usage
88
+
89
+ 1. Start the MCP server:
90
+
91
+ ```bash
92
+ androidtvmcp --host localhost --port 8080
93
+ ```
94
+
95
+ 2. Configure your MCP client to connect to the server
96
+
97
+ 3. Use Android TV control tools through your AI assistant
98
+
99
+ ### Example Commands
100
+
101
+ - Navigate: "Move up on the Android TV"
102
+ - Playback: "Pause the current video"
103
+ - Apps: "Launch Netflix on Android TV"
104
+ - Status: "What's currently playing on Android TV?"
105
+
106
+ ## Configuration
107
+
108
+ Create a configuration file `config.json`:
109
+
110
+ ```json
111
+ {
112
+ "devices": {
113
+ "discovery": {
114
+ "enabled": true,
115
+ "timeout": 10
116
+ },
117
+ "connection": {
118
+ "timeout": 5,
119
+ "retry_attempts": 3
120
+ }
121
+ },
122
+ "mcp": {
123
+ "host": "localhost",
124
+ "port": 8080,
125
+ "transport": "stdio"
126
+ },
127
+ "logging": {
128
+ "level": "INFO",
129
+ "file": "androidtvmcp.log"
130
+ }
131
+ }
132
+ ```
133
+
134
+ ## MCP Tools
135
+
136
+ ### Navigation Tools
137
+
138
+ - `atv_navigate`: Navigate Android TV interface (up, down, left, right, select, menu, back, home)
139
+ - `atv_input_text`: Send text input to Android TV
140
+
141
+ ### Playback Tools
142
+
143
+ - `atv_playback`: Control media playback (play, pause, stop, fast_forward, rewind)
144
+ - `atv_volume`: Adjust volume (up, down, mute)
145
+
146
+ ### App Management Tools
147
+
148
+ - `atv_launch_app`: Launch specific applications
149
+ - `atv_get_apps`: List available applications
150
+ - `atv_switch_app`: Switch between running applications
151
+
152
+ ### Device Tools
153
+
154
+ - `atv_get_devices`: List discovered Android TV devices
155
+ - `atv_get_status`: Get current device status and state
156
+ - `atv_power`: Power control (on, off, sleep)
157
+
158
+ ## MCP Resources
159
+
160
+ ### Device Information
161
+
162
+ - `device://[device_id]/info`: Device capabilities and information
163
+ - `device://[device_id]/status`: Current device status
164
+ - `device://[device_id]/apps`: Available applications
165
+
166
+ ### Current State
167
+
168
+ - `state://current_app`: Currently active application
169
+ - `state://playback`: Current playback status
170
+ - `state://volume`: Current volume level
171
+
172
+ ## Development
173
+
174
+ ### Setup Development Environment
175
+
176
+ #### Using Virtual Environment (Recommended)
177
+
178
+ ```bash
179
+ # Clone the repository
180
+ git clone https://github.com/pigeek/androidtvmcp.git
181
+ cd androidtvmcp
182
+
183
+ # Create and activate virtual environment
184
+ python -m venv venv
185
+
186
+ # Activate the virtual environment
187
+ # On Linux/macOS:
188
+ source venv/bin/activate
189
+ # On Windows:
190
+ # venv\Scripts\activate
191
+
192
+ # Install in development mode with dev dependencies
193
+ pip install -e ".[dev]"
194
+ ```
195
+
196
+ #### Alternative Setup
197
+
198
+ ```bash
199
+ git clone https://github.com/pigeek/androidtvmcp.git
200
+ cd androidtvmcp
201
+ pip install -e ".[dev]"
202
+ ```
203
+
204
+ ### Run Tests
205
+
206
+ ```bash
207
+ pytest
208
+ ```
209
+
210
+ ### Development Tools
211
+
212
+ The `devtools/` directory contains standalone scripts for manual testing and validation:
213
+
214
+ ```bash
215
+ cd devtools
216
+ python test_command_processor.py # Test command processor functionality
217
+ python test_mcp_client.py # Test MCP client-server communication
218
+ python test_mcp_integration.py # Test MCP server integration
219
+ ```
220
+
221
+ See `devtools/README.md` for detailed information about each script.
222
+
223
+ ### Code Formatting
224
+
225
+ ```bash
226
+ black src/ tests/
227
+ isort src/ tests/
228
+ ```
229
+
230
+ ### Type Checking
231
+
232
+ ```bash
233
+ mypy src/
234
+ ```
235
+
236
+ ## Architecture
237
+
238
+ ```
239
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
240
+ │ MCP Client │◄──►│ AndroidTVMCP │◄──►│ Android TV │
241
+ │ (AI Assistant) │ │ Server │ │ Devices │
242
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
243
+ ```
244
+
245
+ ### Components
246
+
247
+ - **MCP Server**: Handles MCP protocol communication
248
+ - **Device Manager**: Manages Android TV device discovery and connections
249
+ - **Command Processor**: Translates MCP requests to Android TV commands
250
+ - **Network Layer**: Handles Android TV protocol communication
251
+
252
+ ## Requirements
253
+
254
+ - Python 3.8+
255
+ - Android TV devices on the same network
256
+ - Network connectivity for device discovery
257
+
258
+ ## Troubleshooting
259
+
260
+ ### Common Issues
261
+
262
+ 1. **Device Not Found**
263
+
264
+ - Ensure Android TV is on the same network
265
+ - Check firewall settings
266
+ - Verify device discovery is enabled
267
+
268
+ 2. **Connection Failed**
269
+
270
+ - Check network connectivity
271
+ - Verify Android TV remote control is enabled
272
+ - Try restarting the Android TV device
273
+
274
+ 3. **Commands Not Working**
275
+ - Ensure device is powered on
276
+ - Check if device supports the command
277
+ - Verify connection status
278
+
279
+ ### Debug Mode
280
+
281
+ Enable debug logging:
282
+
283
+ ```bash
284
+ androidtvmcp --log-level DEBUG
285
+ ```
286
+
287
+ ## Contributing
288
+
289
+ 1. Fork the repository
290
+ 2. Create a feature branch
291
+ 3. Make your changes
292
+ 4. Add tests
293
+ 5. Run the test suite
294
+ 6. Submit a pull request
295
+
296
+ ## License
297
+
298
+ MIT License - see [LICENSE](LICENSE) file for details.
299
+
300
+ ## Support
301
+
302
+ - [GitHub Issues](https://github.com/pigeek/androidtvmcp/issues)
303
+ - [Documentation](https://androidtvmcp.readthedocs.io/)
304
+ - [MCP Protocol Documentation](https://modelcontextprotocol.io/)
305
+
306
+ ## Related Projects
307
+
308
+ - [androidtvremote2](https://github.com/tronikos/androidtvremote2) - Android TV remote control library
309
+ - [Model Context Protocol](https://modelcontextprotocol.io/) - Protocol specification