{"id":28798199,"url":"https://github.com/maxim/tiny_mcp","last_synced_at":"2025-08-10T06:16:48.603Z","repository":{"id":295538262,"uuid":"990399877","full_name":"maxim/tiny_mcp","owner":"maxim","description":"Make local MCP tools in Ruby and easily serve them","archived":false,"fork":false,"pushed_at":"2025-06-10T02:34:11.000Z","size":28,"stargazers_count":64,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T11:52:58.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-26T04:08:37.000Z","updated_at":"2025-06-29T13:42:49.000Z","dependencies_parsed_at":"2025-05-26T04:29:31.674Z","dependency_job_id":null,"html_url":"https://github.com/maxim/tiny_mcp","commit_stats":null,"previous_names":["maxim/tiny_mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/maxim/tiny_mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim%2Ftiny_mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim%2Ftiny_mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim%2Ftiny_mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim%2Ftiny_mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxim","download_url":"https://codeload.github.com/maxim/tiny_mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxim%2Ftiny_mcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269683928,"owners_count":24458799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-18T05:02:18.845Z","updated_at":"2025-08-10T06:16:48.569Z","avatar_url":"https://github.com/maxim.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# TinyMCP\n\nA tiny Ruby implementation of the Model Context Protocol (MCP) that makes it easy to create and serve tools locally for AI assistants.\n\n## Installation\n\n```bash\ngem install tiny_mcp\n```\n\n## Usage\n\nCreate tools by inheriting from `TinyMCP::Tool`:\n\n```ruby\n#!/usr/bin/env ruby\nrequire 'tiny_mcp'\n\nclass WeatherTool \u003c TinyMCP::Tool\n  name 'get_weather'\n  desc 'Get current weather for a city'\n  arg :city, :string, 'City name' # required\n  opt :units, :string, 'Temperature units (c/f)' # optional\n\n  def call(city:, units: 'c')\n    # Your implementation here\n    \"Weather in #{city}: 20°C, sunny\"\n  end\nend\n\nclass TimeTool \u003c TinyMCP::Tool\n  name 'get_time'\n  desc 'Get current time'\n  opt :timezone, :string, 'Timezone name'\n\n  def call(timezone: 'UTC')\n    Time.now.getlocal(timezone)\n  end\nend\n\n# Serve multiple tools\nTinyMCP.serve(WeatherTool, TimeTool, server_name: 'my_tool')\n```\n\nYou can put this in a `bin/mcp` file for example, and make it executable:\n\n```bash\nchmod +x bin/mcp\n```\n\nThen add it to Claude Code:\n\n```bash\nclaude mcp add my-mcp bin/mcp\n```\n\nThe server reads JSON-RPC requests from stdin and writes responses to stdout.\n\nSee [examples/](examples/) for more.\n\n## Multiple results and different formats\n\nBy default TinyMCP assumes you're returning `text` from your call function. If you want to return image, audio, or a bunch of different results, wrap your return value in an array, and TinyMCP will treat your return value as the whole `content` body.\n\nDon't forget that binary data such as images and audio needs to be Base64-encoded.\n\n```ruby\nrequire 'base64'\n\nclass MultiModalTool \u003c TinyMCP::Tool\n  name 'get_different_formats'\n  desc 'Get results in different formats'\n\n  def call\n    [\n      {\n        type: 'text',\n        text: 'This is a text response'\n      },\n      {\n        type: 'image',\n        mimeType: 'image/png',\n        data: Base64.strict_encode64(File.binread('image.png'))\n      },\n      {\n        type: 'audio',\n        mimeType: 'audio/mpeg',\n        data: Base64.strict_encode64(File.binread('audio.mp3'))\n      }\n    ]\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/maxim/tiny_mcp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/maxim/tiny_mcp/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the TinyMCP project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/maxim/tiny_mcp/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim%2Ftiny_mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxim%2Ftiny_mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxim%2Ftiny_mcp/lists"}