defmodule Wymcp.MixProject do use Mix.Project @source_url "https://git.sr.ht/~wyper/wymcp" def project do [ app: :wymcp, version: "0.1.1", elixir: "~> 1.19", start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), description: "Model Context Protocol server library for Elixir with Plug integration", package: package(), name: "Wymcp", source_url: @source_url, homepage_url: @source_url, docs: [ main: "readme", api_reference: false, source_url_pattern: "#{@source_url}/tree/main/item/%{path}#L%{line}", formatters: ["html"], before_closing_head_tag: &docs_before_closing_head_tag/1, before_closing_body_tag: &docs_before_closing_body_tag/1, extras: [{"README.md", title: "README"}] ++ Path.wildcard("docs/*.md"), groups_for_extras: [ Development: [ "docs/mcp-spec-2025-11-25-overview.md", "docs/mcp-spec-2026-07-28-overview.md" ] ], groups_for_modules: [ "Consumer surface": [ Wymcp.Auth, Wymcp.Auth.Noop, Wymcp.Context, Wymcp.Help, Wymcp.Hint, Wymcp.ProtocolVersion, Wymcp.Router, Wymcp.Server, Wymcp.Session, Wymcp.Telemetry, Wymcp.Testing, Wymcp.Tool ], Internals: [ Wymcp.JsonRpc, Wymcp.Modern, Wymcp.Plugs.Auth, Wymcp.Plugs.Classify, Wymcp.Plugs.Dispatch, Wymcp.Plugs.Era, Wymcp.Plugs.OriginCheck, Wymcp.Plugs.Pipeline, Wymcp.Plugs.ProtocolFields, Wymcp.Plugs.Session, Wymcp.Plugs.SingletonHeaders, Wymcp.Plugs.Validate, Wymcp.Response, Wymcp.ServerInfo, Wymcp.Tool.Schema, Wymcp.Transport.SSE, Wymcp.Transport.Stream ] ] ] ] end def application do [ mod: {Wymcp.Application, []}, extra_applications: [:logger, :crypto] ] end def cli do [preferred_envs: [precommit: :test]] end defp package do [ licenses: ["MIT"], links: %{"Bug Tracker" => "https://todo.sr.ht/~wyper/wymcp", "sourcehut" => @source_url}, files: ~w(lib priv/schema-2025-11-25.json priv/schema-2026-07-28.json .formatter.exs mix.exs README.md LICENSE) ] end defp aliases do [ precommit: [ "compile --warnings-as-errors", "deps.unlock --unused", "format", "credo --strict", "deps.audit", "test --warnings-as-errors" ] ] end defp deps do [ {:bandit, "~> 1.0", only: [:dev, :test]}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.34", only: :dev, runtime: false}, {:ex_slop, "~> 0.4", only: [:dev, :test], runtime: false}, {:jsv, "~> 0.16"}, {:mix_audit, "~> 2.1", only: [:dev, :test], runtime: false}, {:mix_test_watch, "~> 1.0", only: :dev, runtime: false}, {:plug, "~> 1.15"}, {:req, "~> 0.7", only: [:dev, :test]}, {:thousand_island, "~> 1.5", only: [:dev, :test]} ] end defp docs_before_closing_body_tag(:html), do: "" defp docs_before_closing_body_tag(:epub), do: "" defp docs_before_closing_head_tag(:html) do """ """ end defp docs_before_closing_head_tag(:epub), do: "" end